Created
May 20, 2017 17:11
-
-
Save timilsinabishal/7a3e37aee9561606060bcd8b1bb1953a to your computer and use it in GitHub Desktop.
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, path.join(__dirname, 'public', 'upload')); | |
}, | |
fileName: function (req, file, cb) { | |
cb(null, file.fieldName+'-'+Date.now()); | |
} | |
}); | |
const upload = multer({storage: storage}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment