-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Labels
Description
Is there any provision to check whether a filename is valid, or is this something I have to do explicitly?
For example, in my server.js:
app.post('/upload-file', function(req, res) {
var filename = req.files.file.name;
req.files.file.mv(__dirname + '/public/img/' + filename, function(err) {
if(err) {
res.json({err: err});
}
else {
res.json({answer: "File transfer completed"});
}
});
});In this example, if the user's filename was ../../server.js, this could really mess things up badly.