I am uploading an image using multer, I would like to know how to save this image to a specific directory, already with its original extension: .jpeg.
I am uploading an image using multer, I would like to know how to save this image to a specific directory, already with its original extension: .jpeg.
var storage = multer.diskStorage({
destination: function (req, file, cb) {
cb(null, './data/multer')
},
filename: function (req, file, cb) {
cb(null, file.originalname);
}
})
var upload = multer({ storage: storage })