In this article, I’ll assume you’ve followed the Odoo 16- Install guide.
When attempting to upload a PDF or image file to Odoo, you’ll find that any file larger than 1MB generates a popup error message:
UncaughtPromiseError > HTTPError
Uncaught Promise > server responded with invalid JSON response (HTTP413): <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
HTTPError: server responded with invalid JSON response (HTTP413): <html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
at XMLHttpRequest.<anonymous> (https://odoo.robfauls.com/web/assets/203-bb55336/web.assets_backend.min.js:962:69)
The changes below will allow files up to 25MB in size to be uploaded to your Odoo server. If you’d like files larger than 25MB to be allowed, there are additional steps required. These changes involve configuration changes in the Odoo framework itself and is outside the scope of this article.
To work around the 1MB limitation, edit “/etc/nginx/nginx.conf” and set “client_max_body_size 25M;”
After making the change via VI/VIM/nano, save the file and then restart NGINX via “sudo systemctl restart nginx”