PHP dies if the file is too large. How can I prevent this so I can return an error?
ini_set does NOT work with upload_max_filesize since 4.2.3. You can try to modify it with HTACCESS, but once the file starts to execute, upload_max_filesize is locked.
You can try altering the values maximum values that php uses for uploads and script timeouts. See here.
If you have access to php.ini, you can modify it there.
Otherwise, you cant.
EDIT: You CAN use the MAX_FILESIZE input name to nip it in the bud before it sends (Client Side prevention), but not PHP to prevent it.
I’m still puzzled as to how to solve this. Adding the HTML hidden field only returns an error if the file is under the 8mb limit. Any other ideas?