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
React js download file problem with firefox mobile

I have the following code which allows me to create a .srt file to be able to download it later.

It seems to work fine, but when I use Firefox on android device, the file does download but the file format is not correct, it should be .srt instead it is .txt.

It seems to only happen with Firefox on android, on pc it seems to give no problems.

Where am I doing wrong?

const element = document.createElement("a");
const file = new Blob([value], { type: "text/plain" });
element.href = URL.createObjectURL(file);
element.download = name + num + ".srt";
document.body.appendChild(element); // Required for this to work in FireFox
element.click();
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!