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

126
Views
Create .csv and send as response in express/koa

I have some data in csv format and I want to send it as a file attachment (example.csv) to an http response without saving it as a temp file on the fs. Can this be done in express/koa?

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

0

If you have constructed a string of comma-separated values organized into lines separated by "\n", you can send it as an attachment with express middleware like the following:

app.get("/csvdownload", function(req, res) {
  var csv = "A,B\n1,2\n";
  res.set("Content-Disposition", "attachment; filename=whatever.csv");
  res.type("csv");
  res.end(csv);
});
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!