I have following for upload files into S3
const upload = extension => multer({
storage: multerS3({
s3,
bucket,
acl,
metadata(req, file, cb) {
cb(null, { fieldName: file.fieldname });
},
...
}),
});
router.post(
'/upload',
upload('jpg').array('files', 5),
(req, res) => {
console.log(req.files);
...
It is possible to make some kind of function for each single uploading file (to write some information about file into DB before multer begin uploading next file) or for this I need upload each file separately?
Thank you