Ok here is how to fix this,
Also, this 20MB limit is hard coded into the self-hosted invoice-ninja-app,
I had to go to their slack channel to get this fix, they were very helpful there, but why this is not documented is beyond me. Anyways here’s the fix:
This is for docker if you not running on docker the steps need to account for it:
- copy the “Requests.php” file out for editing:
docker cp invoiceninja-app-1:/var/www/app/app/Http/Requests/Request.php /path/to/somewhere/
- edit the file and change the
max:20000
to max:<value>
protected $file_validation = 'sometimes|file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx,webp|max:20000';
to
protected $file_validation = 'sometimes|file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx,webp|max:100000';
- copy the “Requests.php” file back to its original location:
docker cp /path/to/somewhere/Request.php invoiceninja-app-1:/var/www/app/app/Http/Requests/
try uploading a file now and it should work.
Remember: you also may need to also set the
- in “php.ini” under docker container “/usr/local/etc/php”:
post_max_size = 100M
upload_max_filesize = 100M
memory_limit = 256M
max_execution_time = 300
max_input_time = 600
- in “in-vhost.conf” under “invoiceninja/config/nginx”:
client_max_body_size 100M;
Note: “post_max_size” should always be bigger than “upload_max_filesize” and “memory_limit” should always be bigger than both of them.
So, “memory_limit” > “post_max_size” > “upload_max_filesize”
Finally: reload the cache for your website
yourdomain.com is available for purchase - Sedo.com<UPDATE_SECRET you have in your env file>