i want use firebase functions for a multipart upload.
This is my code:
const uploadVideo = Multer({
storage: MulterStorage,
limits: {
fileSize: 5 * 1024 * 1024, // no larger than 5mb, you can change as needed.
},
fileFilter: (req, file, cb) => {
console.log('FILE', file);
const mimetype = file.mimetype.split('/')[0];
console.log('FILE', mimetype);
if (mimetype !== 'video') {
cb('Error: File is not an video');
}
return cb(null, true);
},
}).single('blob');
But when i call the functions i have this error:
ERROR TypeError: Cannot read property 'filename' of undefined
I don't have this error in localhost.