Error: request entity too large

后端 未结 21 3100
无人共我
无人共我 2020-11-22 06:36

I\'m receiving the following error with express:

Error: request entity too large
    at module.exports (/Users/michaeljames/Documents/Projects/Proj/mean/node         


        
21条回答
  •  北海茫月
    2020-11-22 07:13

    The following worked for me... Just use

    app.use(bodyParser({limit: '50mb'}));
    

    that's it.

    Tried all above and none worked. Found that even though we use like the following,

    app.use(bodyParser());
    app.use(bodyParser({limit: '50mb'}));
    app.use(bodyParser.urlencoded({limit: '50mb'}));
    

    only the 1st app.use(bodyParser()); one gets defined and the latter two lines were ignored.

    Refer: https://github.com/expressjs/body-parser/issues/176 >> see 'dougwilson commented on Jun 17, 2016'

提交回复
热议问题