MulterError:使用Node.js和Express的文件太大

时间:2019-06-27 23:01:46

标签: node.js express google-cloud-storage multer

我对Multer构造函数中设置的文件大小没有限制,但出现错误

MulterError: File too large
    at abortWithCode (/Users/kelseygbates/demo3/node_modules/multer/lib/make-middleware.js:79:22)
    at FileStream.<anonymous> (/Users/kelseygbates/demo3/node_modules/multer/lib/make-middleware.js:141:11)
    at FileStream.emit (events.js:193:13)
    at PartStream.onData (/Users/kelseygbates/demo3/node_modules/busboy/lib/types/multipart.js:220:18)
    at PartStream.emit (events.js:193:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at PartStream.Readable.push (_stream_readable.js:231:10)
    at Dicer._oninfo (/Users/kelseygbates/demo3/node_modules/dicer/lib/Dicer.js:191:36)
    at SBMH.<anonymous> (/Users/kelseygbates/demo3/node_modules/dicer/lib/Dicer.js:127:10)

当我尝试上传大小为14.9 MB的.mov文件时。我将multer直接连接到Google Cloud Storage存储桶,这是我要存储此文件的位置。根据Multer文档,默认文件大小限制为无穷大,因此我不确定为什么会出现此错误。

谢谢您的帮助!

0 个答案:

没有答案