I got empty array doing below function after follow the documentation.
var multer = require('multer');
var upload = multer();
router.post('/image', upload.array('photos', 4), function(req, res) {
var file = req.files;
console.log('======')
console.log(file);
res.end();
});
<form action="/products/image" method="post" enctype="multipart/form-data">
<input type="file" name="file" value="upload" multiple>
<input type="submit" value="upload">
</form>
But the strange thing is this actually work
router.post('/image',upload.single('avatar'), function(req, res) {
var file = req.files;
console.log('======')
console.log(file);
res.end();
});
with single file upload.