I'm using nodejs to send file streams to express response
var fileReadStream = fs.createReadStream(filePath);
fileReadStream.pipe(res);
The problem is, on the front-end, the file is downloadable only with the "download", and without extension. And this makes the file unable to use (as no extension).
please add this header before sending the response(replace the filename according your need):
var fileReadStream = fs.createReadStream(filePath);
res.setHeader('Content-disposition', 'attachment; filename=YOUR_FILE.EXTENSION');
fileReadStream.pipe(res);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With