$http.post: Large files do not work

后端 未结 3 644
甜味超标
甜味超标 2020-12-21 07:13

I am trying to upload files through my web app using the following code.

View:

  
3条回答
  •  一整个雨季
    2020-12-21 07:53

    I take the chance and assume you are using bodyParser as middleware. bodyParser has a default limit of 100kb. Look at node_modules/body-parser/lib/types/urlencoded.js :

    var limit = typeof options.limit !== 'number'
        ? bytes(options.limit || '100kb')
        : options.limit
    

    You can change the limit in your app.js by

    var bodyParser = require('body-parser');
    ...
    app.use(bodyParser.urlencoded( { limit: 1048576 } )); //1mb
    

提交回复
热议问题