You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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){varfilename=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.
The text was updated successfully, but these errors were encountered:
@ericman314 there is currently no provision to validate the filename, for now you'll have to check manually - but I'll start working on this and have it out in the next release.
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
:In this example, if the user's
filename
was../../server.js
, this could really mess things up badly.The text was updated successfully, but these errors were encountered: