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

160
Views
La descarga de JS no descarga el archivo completo

Estoy tratando de descargar un archivo csv con 3607 líneas (1,0 Mb):

 const hiddenElement = document.createElement('a'); const fileContent = `data:text/csv;charset=ansi,${res.data}`; hiddenElement.href = fileContent; hiddenElement.target = '_blank'; hiddenElement.download = 'file.csv'; hiddenElement.click();

El contenido en res.data está completo (así como fileContent ), pero cuando descargo el csv, el archivo solo tiene 149 líneas (4,4 Kb) en lugar del tamaño original.

¿Puede alguien ayudarme por favor?

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

0

El problema era que las URL no podían tener más de 2048 caracteres.

about 4 years ago · Juan Pablo Isaza Report

0

Enfrenté el mismo problema y la misma descarga de CSV que solía funcionar antes y descargar el archivo completo.

Tuve que cambiar a lo siguiente:

 const blob = new Blob([csvData], { type: 'text/csv' }) const url = window.URL.createObjectURL(blob); const link = document.createElement('a') link.setAttribute('href', url)
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!