Created
May 14, 2019 21:08
-
-
Save luizpicolo/6255a525b44de36e9684ed9e25b135c4 to your computer and use it in GitHub Desktop.
codigo_multer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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