MEANJS : 413 (Request Entity Too Large)

后端 未结 3 1417
清歌不尽
清歌不尽 2021-01-11 13:55

I am using a MEANJS stack, I upload an image using ng-flow and save the imgsrc as base64 url.

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARkAAACzCAYAAAC94Gg

3条回答
  •  天命终不由人
    2021-01-11 14:02

    Recently, I confronted with this issue and I just added app.use(bodyParser.json({ limit: "50mb" })); this one line in my express app, it just worked :)

    And also one more thing don't forget to add above code line before app.use(bodyParser.json()) this otherwise, it won't work.

    Whatever you set values regarding bodyparser you've to do before the above code line.

    Because, express will go back to its default values and your change won't get effect. I hope this might help :)

提交回复
热议问题