Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda