Contribution fails silently when file size is too large

Some users on my Omeka install are reporting that when they try to upload a file that is too large, it simply returns them to the contribution form without alerting them that there was an error. It gives no indication that a contribution has not been successfully made.

How would I check file size during validation of the form and display an alert if it is too large?

The site is the Harvey Memories Project and the customized Contribution plugin we are using is on Github.

The usual case where it just seems like “nothing happened” is if the post_max_size PHP setting is exceeded. This is problematic for us to deal with since PHP doesn’t really usefully inform the code that this is what has happened, instead the POST data just comes back to us as empty. Omeka S tries to deal with this with a system-wide error, but Omeka Classic doesn’t have that.

You can check sizes on the client side before submission, and that’s probably the best option to have a user-friendly experience. If you get the file input element with Javascript, it has a files property you can use to get the size of a file to be uploaded.

This topic was automatically closed after 250 days. New replies are no longer allowed.