I want the user to be able to query the database and download a nicely formatted txt file with their results. What is the best way of doing this? Right now I write to a temp file, let the user download it, and then delete the accumulated files once a week. Is there a NodeJS way of doing this?
Asked
Active
Viewed 1,399 times
3
-
how do you read your data? from what database or file? – wayne Apr 23 '13 at 03:45
-
Set the correct http headers and just send the result from the database? See http://stackoverflow.com/questions/7288814/download-a-file-from-nodejs-server – Andreas Hultgren Apr 23 '13 at 08:21
-
And how do you format the file, with node or something else? – Zlatko Apr 23 '13 at 09:17
-
Database is elasticsearch. I write the results to a text file using NodeJS and send that text file. – arknave Apr 23 '13 at 12:38