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

212
Vistas
Print file on client side

I am using FileSaver.js to print an object array on the client side (HTML/Typescript).

var blob = new Blob([JSON.stringify( marray)], {type: "text/plain;charset=utf-8"});
 saveAs(blob, "Data.txt");

It works fine. The problem is it downloads in the download folder (by default). I want to add a file path along with its name. Any idea? Or another way to do this job. fs is not working in this case. it is not recognizing fs and gives the error fs.writefilesync is not a function

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

  1. How do you know what path the user has?

  2. It is not safe. There is no way to "climb" the user's file system

  3. If you open the source code, you will see the simplest implementation scheme there. It's just a click on a link download

    var a = document.createElement('a')
    // ...
    a.href = blob
    // ...
    a.dispatchEvent(new MouseEvent('click'))
    
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