Node js request entity too large with multer upload

后端 未结 2 984
天涯浪人
天涯浪人 2021-02-09 18:20

well I\'ve tried different ways to upload a 200k file increased the limit changed parameters, did everything I changed the multer. Fucei everything I knew what I read in the sta

2条回答
  •  情深已故
    2021-02-09 19:01

    I can't tell by all of your code but just by looking at the error, you should be able to set the body post size with the following:

    https://www.npmjs.com/package/multer#limits

     multer({
        storage: storage,
        limits: { fileSize: maxSize }
     })
    

    If that doesn't solve your issue, bodyParser also has a limit. It's options can be found:

    https://github.com/expressjs/body-parser#limit

    bodyParser({limit: '4MB'});
    

提交回复
热议问题