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

272
Views
how to download a file with express and handle with errors

i have a post method "/exports" that gets information out of a database and creates a xml file. at the end of the funktion, i want the user to download this xml file. therefore I used this:

 res.download('./downloads/'+ name+".xml", (err)=>{
      if(err) console.log(err)
 })
 res.redirect('/');

But I only got this error then:

Error: Request aborted
    at onaborted (/home/ec2-user/environment/node_modules/express/lib/response.js:1030:15)
    at Immediate._onImmediate (/home/ec2-user/environment/node_modules/express/lib/response.js:1072:9)
    at processImmediate (node:internal/timers:466:21) {
  code: 'ECONNABORTED'
}

The name of the file and the direction is correct, so I don't know what this error means.

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!