i got this error when trying to upload an image using multer. this is my fileStorage settings:
const fileStorage = multer.diskStorage({
destination: (req, file, cb) => {
cb(null, 'images');
},
filename: (req, file, cb) => {
cb(null, new Date().toISOString() + '-' + file.originalname);
}
});
and this is the middleware of multer
app.use(
multer({ storage: fileStorage, fileFilter: fileFilter }).single('image')
);