But I can't get the file name and the file type ( or extension ). Can anyone help me with that?
Express has a helper for this to make life easier.
It transfers the file at path as an “attachment”. For instance:
app.get('/download', function(req, res){
const file = `${__dirname}/upload-folder/dramaticpenguin.MOV`;
res.download(file); // Set disposition and send it.
});