我想使用firebase功能进行分段上传。
这是我的代码:
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');
但是当我调用这些函数时,我有这个错误:
ERROR TypeError: Cannot read property 'filename' of undefined
我在localhost中没有出现此错误。