Im using the FileReader to convert a Blob (Created from a file thats greater then 2GB) into a base64 string. But sadly I'm ending up with the following error:
DOMException: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired
It works fine if the file is below 2GB.
Converter:
private convertBlobToBase64 = (blob: Blob, filename: string) => new Promise<FileForSaveInDevice>((resolve, reject) => {
console.log('Blob', blob);
const reader = new FileReader();
reader.onerror = reject;
reader.onload = () => {
resolve({ base64: reader.result as string, filename });
};
reader.readAsDataURL(blob);
});
I found a simmelar question, which didn't get answered: FileReader: DOMException, Unable to convert blob to arrayBuffer again and again
1条答案
按热度按时间k4aesqcs1#
为什么你要这样做?我建议你把文件分成块