KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to get an user download his file and remove it after response get finished: app.get('/download/:file', function (req, res) { var filePath = '/files/' + req.param('file'); res.download(file); fs.unlink(filePath); }); In the code above fs.unlink could invoked early than res.download will get finished.
Tags (comma-separated)
Save Edits
Cancel