I've been stuck on this for a while now. For some reason I can't get this to work. What I'm trying to do is get the name of downFile:
app.get('/download', function(req, res){
var selectedFile = req.body.downFile;
var file = __dirname + '/uploads/' + filename;
var filename = path.basename(file);
var mimetype = mime.lookup(file);
res.setHeader('Content-disposition', 'attachment; filename=' + filename);
res.setHeader('Content-type', mimetype);
var filestream = fs.createReadStream(file);
filestream.pipe(res);
});
If anyone knows how to properly get the name of "downFile" I would much appreciate.

var file = __dirname + '/uploads/' + filename;?name of "downFile"do you mean the value of the input withname="downFile"?