Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
codigo_multer.js
const storage = multer.diskStorage({
destination: function(req, file, cb){
cb(null, 'public/uploads/');
},
filename: function(req, file, cb){
cb(null, `${file.filename}-${Date.now()}.${path.extname(file.originalname)}`);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.