Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!