I am using Vude-Dropzone + Express.js + Multer.
No problem to upload single file, but for multiple file it give me error "MulterError: Unexpected field".
I have the same problem here but I am working with ReactJS, I already solved it before with a single upload but it's not working for the array.
Any help is appreciated.
I am using Vude-Dropzone + Express.js + Multer. No problem to upload single file, but for multiple file it give me error "MulterError: Unexpected field".
Codes in express.js & multer:
I've tried to change dropzoneOptions to
paramName: function() { return 'file'; },
paramName: file,
Change multer to:
router.post('/uploadPhoto/:id', uploadImg.array('file', 10), Photo.uploadPhoto);
router.post('/uploadPhoto/:id', uploadImg.fields([{ name: 'file', maxCount: 10 }]), Photo.uploadPhoto);
But, no one success.
Any ideas how to solve this problem ?