Unable to upload files greater than 128mb via http
We have a weird issue that popped up on our website and after several rounds with inMotion Support, they recommended I post here We have an upload form that abruptly resets the connection when trying to upload files over 128mb. Please know ahead of time that inMotion Support has verified that our php.ini file is correctly configured. Also, this script worked perfectly last year -- Our members only post files from March to June, so I can't pinpoint a time when this behavior began.
On our site, we allow members to upload files to the server. This is in a secure area, but for testing purposes we have also created a very simple PHP upload script, but the behavior is the same.
â?¢ The problem only manifests with files larger than 128 MB. We have verified a file of ~127MB uploads successfully even on a slow connection with the whole transaction lasting >5:00, but a file of ~130MB fails ~:15 after the form has submitted. This is very specific behavior.
â?¢ There are no decisions made regarding acceptance of a file upload based on its size or anything else that would explain this very specific behavior in our php code.
â?¢ There is no JS running on the client that could make a decision based on file size or account for this very specific behavior.
â?¢ There are no 3rd party libraries or unknown quantities in play here. This is straight-up, kind of boring PHP...
â?¢ We are experiencing the same very specific behavior uploading a file >128MB using a completely different php script on your server that is outside of our main codebase.
â?¢ This script is in use on other websites with other hosting services.
Because we are on a shared hosting package at inMotion, changing any Apache configurations (even if they're incorrect) does not seem to be an option. I would greatly appreciate any help you might be able to give.
On our site, we allow members to upload files to the server. This is in a secure area, but for testing purposes we have also created a very simple PHP upload script, but the behavior is the same.
â?¢ The problem only manifests with files larger than 128 MB. We have verified a file of ~127MB uploads successfully even on a slow connection with the whole transaction lasting >5:00, but a file of ~130MB fails ~:15 after the form has submitted. This is very specific behavior.
â?¢ There are no decisions made regarding acceptance of a file upload based on its size or anything else that would explain this very specific behavior in our php code.
â?¢ There is no JS running on the client that could make a decision based on file size or account for this very specific behavior.
â?¢ There are no 3rd party libraries or unknown quantities in play here. This is straight-up, kind of boring PHP...
â?¢ We are experiencing the same very specific behavior uploading a file >128MB using a completely different php script on your server that is outside of our main codebase.
â?¢ This script is in use on other websites with other hosting services.
Because we are on a shared hosting package at inMotion, changing any Apache configurations (even if they're incorrect) does not seem to be an option. I would greatly appreciate any help you might be able to give.
Apache error logs and ModSecurity
To troubleshoot further I took a look at the tcmpdump info for my domain during the request, I also had a grep running for my IP to your website's access log, and the Apache error logs: This is what I noticed in the Apache error log: So it's ModSecurity that's intercepting your large POSTs, as 134217728 bytes is 128MB. This is a setting that can be raised at the server-wide level with the SecRequestBodyInMemoryLimit directive. However, I believe this is the default ModSecurity setting, and not something I'm sure we'll change on shared hosting. I can check for you tomorrow to find out for sure, and update this answer accordingly. Sorry for the troubles, and thanks again for providing a great deal of info in your question. - Jacob