Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

436
Vistas
FileReader: DOMException, Unable to convert blob to base64 String

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

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Why you have to do that? I suggest u to divide file in chunks

blobInChunks(blob:Blob) {
    let chunkSize = 1024 * 1024 * 64; //64Mb
    let chunks = Math.ceil(blob.size/chunkSize) ;
    let chunk = 0 ;

    let _chunksArray:Blob[] = [] ;
  
    while (chunk++ <= chunks) {
        let offset = chunk*chunkSize ;
        _chunksArray.push(blob.slice(offset, offset + chunkSize)) ;
    }

    return _chunksArray ;
}
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda