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

313
Views
How to set a FILE Name while downloading a file from FileReader?

I'm trying to download a file from a server using FileReader, when it downloads the file like download.zip, but I want to set some different file names here.

        var newBlob = new Blob([blob], { type: blob.type })
        var reader = new FileReader();

        reader.onload = function(e){
        window.location.href = reader.result ? reader.result.toString() : "";
        }
        reader.readAsDataURL(newBlob);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can update the file name of what you want using the reader.fileName

var reader = new FileReader();
 reader.fileName = file.name // file came from a input file element
 reader.onload = function(readerEvt) {
    console.log(readerEvt.target.fileName);
 };
about 4 years ago · Juan Pablo Isaza Report
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!