Node.js error: too many parameters Error while uploading bulk data

后端 未结 3 1113
独厮守ぢ
独厮守ぢ 2020-12-31 08:43

I have a task to upload user data in bulk through csv file. I am using nodejs and express framework. When i submit csv file having 60 to 70 rows it

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-31 09:25

    As others mention, you'll need to set the parameterLimit to deal with the "too many parameters" error. You may also need to set the limit to a larger size to avoid a load size error. In the case of CSV, the urlencoded limits will be applied, but others may also want to set the JSON limits too. The following setting will work unless there are other places in the code that are overriding these settings:

    var bodyParser = require('body-parser');
    app.use(bodyParser.json({limit: '50mb'}));
    app.use(bodyParser.urlencoded({limit: '50mb', extended: true, parameterLimit: 1000000}));
    

提交回复
热议问题