I have a task for loading user data in bulk through a csv file. I am using nodejs and express frameworks. When I send a csv file from 60 to 70 lines, it works fine, but when it exceeds 70 lines, it starts to give too many parameters to the server error. After some research, I came to the conclusion that this may be a problem with the size of the body parser, so I tried this blog , but it did not work, the error is still the same.
here is my code for the body parser:
var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); app.use(cookieParser()); app.use(bodyParser({limit: '50mb'})); app.use(bodyParser.json({limit: '50mb'})); app.use(bodyParser.urlencoded({ extended: false }));
Error message:
2016-04-19T10:29:45.299Z - error: [req#d3a1fa1a-278e-496e-9cb1-b3a944e3d1c8/app] [App] Error: too many parameters Error: too many parameters at queryparse (d:\Git\gap-vm 13416\node_modules\body-parser\lib\types\urlencoded.js:119:17) at parse (d:\Git\gap-vm 13416\node_modules\body-parser\lib\types\urlencoded.js:64:9) at d:\Git\gap-vm 13416\node_modules\body-parser\lib\read.js:91:18 at IncomingMessage.onEnd (d:\Git\gap-vm 13416\node_modules\raw-body\index.js:136:7) at IncomingMessage.g (events.js:273:16) at emitNone (events.js:80:13) at IncomingMessage.emit (events.js:179:7) at endReadableNT (_stream_readable.js:906:12) at nextTickCallbackWith2Args (node.js:474:9) at process._tickCallback (node.js:388:17)
So can anyone tell me where I am going wrong. Any suggestion would be helpful. Thanx in advance.
Srw. . .
source share