Does anyone know how to report to the end user that their file is too large to upload?
I am writing a page which uploads a file to be attached when sending an email. The limit for the file to be uploaded is 10MB.
The system is working properly for files uploaded which are under 10MB. However, I would like to give the user a message when they upload a file over 10MB.
My HTML form uses the php standard:
<input type=hidden name="MAX_FILE_SIZE" value="10485760">
My .htaccess file has these settings:
php_value upload_max_filesize 10485760
php_flag track_errors on
My phpInfo() says:
upload_max_filesize = 10MB
post_max_size = 11 MB
When uploading a file larger than 10MB, but less than 11MB, the page is reloaded with the most recent php error:
stat failed for none (errno=2 - No such file or directory)
(this is the same error that I receive when simply loading the page initially, so it's not very useful)
When uploading a file larger than 11MB
Netscape tells me, "A network error occurred while sending data. Connection reset by peer."
IE either doesn't load, or Cannot find Server.
Does anyone know a workaround? Does anyone know if php actually sends any of the form data in these instances where the file exceeds the upload or posting limits? Is there anything I can do to overcome this problem?