Details
Upload File Size Limits
By Paul
Dec 07, 2018 pm31 4:51 PM (Edited )
Next to installing broken custom mod_security rules, the second most annoying thing web hosts do is set rediculously low maximum file upload sizes. Often they'll have upload limits of 2 MB, which isn't even enough to upload a photo taken from a phone. Confusingly, sometimes they have a large limit set for max_upload_filesize but then a small limit for max_post_size which also indirectly acts as a limit on the uploaded file size.
Because this results in a lot of support issues for me, in recent months I made WSN automatically configure the Admin -> Settings -> Files -> Max Attachment File Size to make it smaller than the php.ini limits set by the host. And yet, this ended up creating a different issue. After people go to their web hosts and ask for the limit to be increased, they're confused that they still get a message saying they can't upload larger files -- because they don't realize there's a setting they have to change.
The solution I implemented this week doesn't apply to old installations (for which this generally isn't an issue) but does apply to all new installs of 10.3. In all new installs, the Admin -> Settings -> Files -> Max Attachment File Size value is blank until manually filled in. A blank value is interpreted to mean "make the maximum be just below what the php.ini allows". WSN calculates the lower of the upload_max_filesize and post_max_size php.ini values in real time and makes that the dynamic upload size limit. The upshot of this is that when the host fixes the php.ini there's no need to change anything in WSN for larger files to start working. Most people get as large of files allowed as they can, and anyone who cares to set a low upload limit to protect their server disk space still has the option.
By Paul
Dec 07, 2018 pm31 4:51 PM (Edited )
Because this results in a lot of support issues for me, in recent months I made WSN automatically configure the Admin -> Settings -> Files -> Max Attachment File Size to make it smaller than the php.ini limits set by the host. And yet, this ended up creating a different issue. After people go to their web hosts and ask for the limit to be increased, they're confused that they still get a message saying they can't upload larger files -- because they don't realize there's a setting they have to change.
The solution I implemented this week doesn't apply to old installations (for which this generally isn't an issue) but does apply to all new installs of 10.3. In all new installs, the Admin -> Settings -> Files -> Max Attachment File Size value is blank until manually filled in. A blank value is interpreted to mean "make the maximum be just below what the php.ini allows". WSN calculates the lower of the upload_max_filesize and post_max_size php.ini values in real time and makes that the dynamic upload size limit. The upshot of this is that when the host fixes the php.ini there's no need to change anything in WSN for larger files to start working. Most people get as large of files allowed as they can, and anyone who cares to set a low upload limit to protect their server disk space still has the option.
Views | 80 views. Averaging 80 views per day. | ||||
Similar Listings |
|
Sorry, you don't have permission to post. Log in, or register if you haven't yet.
Please login or register.