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

99
Views
res.download no funciona en mi caso cuando paso la variable desde window.location.href

Quiero descargar mi archivo que ha sido generado con res.download.

Estoy pasando el nombre de archivo variable y la ruta de esta manera:

 window.location.href = "/transaction/api/downloadfile?filename="+res.filename; }, 3000);

Y aquí está mi código para descargar el archivo en las rutas.

 router.get("/api/downloadfile", function (req, res) { console.log(req.query.filename); res.download(req.query.filename); res.render("pages/Admin/PO/createpo"); });
Aquí está req.query.filename: D:\stock-management-project(1)\stock-management-project\z1z97bvhbh9.pdf

Por favor, ayúdame con este problema :)

Gracias a todos.

about 4 years ago · Juan Pablo Isaza
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!