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

161
Vistas
How to avoid NotReadable occurring while using FileReader

I am writing a code to read a file attachment using FileReader. When the code gets executed on certain machines, I'm receiving NotReadable Error from the error callback

DOM Exception: The requested file could not be read, typically due to 
permission problems that have occurred after a reference to a file is acquired

Below is my code:

$(document).on("change", "input[type='file']", function (event) {
  var files = event.target.files;
  if (files[0]) {
    var reader = new FileReader();
    reader.onload = () => {
      $(event.target)
        .closest(".row")
        .find(".attachment-data")
        .val(reader.result.split(",")[1]);
    };
    reader.onerror = (error) => {
      //Always ends up here on certain devices
      console.log("reader.onerror", error);
    };
    reader.readAsDataURL(files[0]);
  }
});
about 4 years ago · Juan Pablo Isaza
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