Nodejs 413 request entity too large error

N

There are several ways to resolve this issue. First, you should check with your hosting provider to see what settings they recommend. Second, you can try increasing the memory limit on your web server. Third, you can use a different method to upload the file instead of using FTP (File Transfer Protocol). Finally, you can split up the file into smaller parts and upload them one at a time.

If you’re using Expressjs and receive this error, then it’s a pretty simple solution to change upload size limit with the following command:


app.use(express.json({limit: '50mb'}));

app.use(bodyParser.json({ limit: "200mb" }));

app.use(bodyParser.urlencoded({ limit: "200mb",  extended: true, parameterLimit: 1000000 }));

You can change the file size limit as required to meet your needs.

If this doesn’t solve your problem then it might be an issue with your web server. I’ve also got answers to help you solve whether you’re using NGINX or Apache.

About the author

By Jamie

My Books