Nodejs 413 request entity too large error Nodejs 413 request entity too large error

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.

Published on Jul 31, 2022

Tags: Node js Tutorial | nginx | express

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.

Tutorials

Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.