Wednesday, 4 April 2018

ExpressJS Post download works but download windows wont appear?

Hello,hopefully this is the right place to askim trying to create a download for a user but somehow my download doesnt work even tho it works?Let me explain : Server post request :app.post('/downloadRequest', function (req, res) { var fileName = "testname.txt"; var file = __dirname +'/test.txt'; res.download(file,fileName,function(err) { if(err) throw err; console.log("downloaded"); }); }); When im calling it,no error message appears. Also it shows "downloaded" in the console.Im clueless..

Submitted April 04, 2018 at 05:30PM by Kageyashax

No comments:

Post a Comment