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

273
Vistas
How to write to local file in fetch?

I need to write some data to local file using fetch. When i try to do my method, it is not working. Maybe fetch can not write files - i dont know. Thank you!

let recv = document.getElementById("recv").value;
  let money = document.getElementById("cost").value;
  fetch(recv+'.txt')
  .then(response => response.text())
  .then(data => {
    // Do something with your data
    let hernmon = data;
   int1 = parseInt(hernmon);
   int2 = parseInt(money);
   int3 = parseInt(moneyint)
   let outmon = int1 + int2;
    data = outmon;
  });
  fetch(name+'.txt')
  .then(response => response.text())
  .then(data => {
    // Do something with your data
    let hernmon = data;
   int1 = parseInt(hernmon);
   int2 = parseInt(money);
   int3 = parseInt(moneyint)
   let incmon = int3 - int2;
    data = incmon;
  });
  return
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can not directly write to a local file, since that would cause massive security problems, but you can create files in the browser using Blob and URL.createObjectURL. All recent browsers support this and provide it as a download link for the user. You can suggest a file name via the download attribute of the link, in browsers that support the download attribute. As with any other download, the user downloading the file will have the final say on the file name though...

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