413 Request Entity Too Large On Large Attachment Uploads

I have a need to attach a 20MB uploaded PDF file to an invoice.

Whenever I try to do so, I receive a 413 Request Entity Too Large error. I’ve gone through my php.ini settings and changed them, as well as made changes to .htaccess.

This leads me to believe there’s some limit in Invoiceplane itself but that doesn’t sound right. Can anyone let me know how to troubleshoot/fix?

Thanks in advance!

The maximum file size is set in your php,ini file. Change that and restart the web server.

1 Like

Besides crafter’s excellent tips I would advice you to think about a 20MB file as attachment even.
Why so big?

Hey Crafter – I did that. It doesn’t seem to take. I tried editing the apache2 php.ini file, the php72 cli php.ini file, and even used .htaccess. Is there any way I can validate the settings outside of invoiceplane?

Great question. I use Microsoft OneNote to take pictures of receipts with my iPhone. It stores the pictures in a large format, and there are lots of receipts for expenses over several days. I then export the OneNote to PDF, and get a large file.

My clients don’t mind, since they can just view the invoice online and download the attachments.

1 Like

I know you said this, but are you using Apache or Nginx. (Just making doubly sure.)

Also, if you are using PFM you might need to find the PHP ini file for pfm and change that value too.

Oh man… if you’re invoicing your expenses to your customers you are going to love the feature I have in mind for invoiceplane2 .
Glad that I got the huge file situations cleared up :slight_smile:

I want to thank both of you for your help.

@UnderDog: I’m very excited about what you’ve got coming!

@crafter: I run Invoice Plane on apache2, but for various reasons I have an nginx reverse proxy in front of it. I ran a phpinfo(); page on my apache2 and it verified that everything was set up fine, so I knew that nginx was the culprit. I found this page which then explained what to do–restarted nginx and it worked! Setting client_max_body_size in nginx is required for large file loads.

Hope this helps someone else!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.