I have a front-end entry form using the Guest Entries plugin, with a file input for the user to upload a photo. I am also using the jQuery Form plugin for AJAX submission, but the behavior is the same if I disable it.
The form works great with small file sizes, but if the uploaded image is larger than PHP's upload_max_filesize
, I get a fatal error: Imagine\Exception\RuntimeException: Unable to open image
.
If the uploaded file is larger than PHP's post_max_size
, the page simply reloads - no error is registered. I gather that this error can be difficult to catch, so maybe it's impossible to have a more graceful failure in this case.
However, for file sizes between upload_max_filesize and post_max_size, shouldn't there be a way to return that as a proper error in the errors array, instead of dying in a way that is unhelpful to the end user?