Error 413 when uploading attachments (pdf) over 5mb

I’m trying to upload pdf attachments that are over 5mb and it fails with error 413. It errors out right away when Send to Server is pressed and catalina.out does not update when tailed.

I’ve confirmed the default of 100GB is the maximum attachment size in the xwiki preferences. Any suggestions? thank you in advance.

xwiki 11.2/postgresql

1 Like

Would be better if you could paste the complete error with the full stack trace.

There was no stack trace provided. here is what I’m seeing:

i’ve uploaded 17 other pdfs less than 500KB and worked just fine. As soon as the PDF was 5MB it gave me the error. Tried on different pdfs 6MB, 10MB; same error. That’s what led me to believe it’s a size issue.


You need to check the Network tab (from browser’s developer tools). Inspect the HTTP request made when you click on “Send it to the Server”. Look at the response, there should be a stack trace there.

The alternative is to try to upload the file from view mode, using the Attachments tab at the bottom of the page. That should log an exception on the server side if there is a problem.

thank you for the directions, mflorea!!

Network inspector showed the error below which I was then able to google and found it was an nginx setting that prevents uploads over 1MB.

413 Request Entity Too Large

413 Request Entity Too Large

nginx/1.14.0 (Ubuntu)

1.sudo nano /etc/nginx/nginx.conf
2.added the line to disable upload check with “client_max_body_size 0;”
3. service nginx restart

Great, thanks for posting back!