I have an application that complains that the file size is too large. I tried using express urlencoded and specifying 50010241024 there, it didn't work. I installed body-parser and tried again, similar and strange behavior here. Please tell me how can I fix this?
app.use(bodyParser.json({ limit: 500*1024*1024, extended: true }));
app.use(bodyParser.urlencoded({ limit: 500*1024*1024, extended: true }));
You can use this with Express 4 to limit request body size/Upload file size, instead of express.json() and express.urlencoded(), you must require the body-parser module and use its json() and urlencoded() methods, if the extended option is not explicitly defined for bodyParser.urlencoded(), it will throw a warning (body-parser deprecated undefined extended: provide extended option).
var bodyParser = require('body-parser');
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));