logo
Search
showing results for - "multer save file with extension"
Jacobo
12 Jan 2018
1var multer = require('multer');
2var path = require('path')
3
4var storage = multer.diskStorage({
5  destination: function (req, file, cb) {
6    cb(null, 'uploads/')
7  },
8  filename: function (req, file, cb) {
9    cb(null, Date.now() + path.extname(file.originalname)) //Appending extension
10  }
11})
12
13var upload = multer({ storage: storage });
similar questions
upload different files in different folders using multer in nodejsmulter 28 29change destination of file multerexpress multerexpress multer examplepuppeteer example multiple file uploadmultermulter rename filehow to set file type and size in multerexample formidable multiple image upload
queries leading to this page
how to get file extension in multerfile extention multermulter file uploads without extensionmulter not save image with extensionfile extension multerstoring file with extension multermulter upload file with extensionmulter file extensionmulter save file with original namemulter save file with extensionuse multer to save files locallysaving files with multermulter save file in node jsmulter not save file extensionsave file with multer in nodejsmulter download file with extensionstore file with multermulter get file extensionmulter without saving file extensionmulter save file with extension
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue