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

322
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

0

No.

There is no API that would provide that information.

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar
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