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

318
Views
Javascript download: detect rename of file

If I use some code like this, to start a Download with Javascript in my browser:

const link = document.createElement("a");
link.style.display = "none";
link.href = URL.createObjectURL(file);
link.download = file.name;
document.body.appendChild(link);
link.click();

Do I have any way to understand if the file has been renamed during download? I mean: if I download two times the file test.txt, the second one is renamed in something like test(1).txt.

Any chance to detect this change in the script?

Thanks!

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Renaming gets done by the browser automatically if there already is a file with the same name. Therefore no.

about 4 years ago · Juan Pablo Isaza Report

0

No.

There is no API that would provide that information.

about 4 years ago · Juan Pablo Isaza Report

0

These no way to detect the filename change.

if u want avoid the duplicated download (file name duplicated) from the same page as alternative solution u can create on an array to store previous 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!