I am working on handling file uploads using express.js and node, and I have basic functionality. I need to implement some security measures, namely to limit the download to certain formats (PNG, JPEG). Is there an easy way to allow only certain formats? Will this go to the parser body?
app.use(express.bodyParser({ uploadDir: __dirname + '/public/uploads', keepExtensions: true })); app.use(express.limit('4mb'));
Are there any other security measures I should consider? Is it a good idea to erase EXIF ββdata from an image?
Thanks,
Ben
bento source share