Page 1 of 1

File upload exceeds upload_max_filesize

Posted: Tue May 25, 2010 8:29 pm
by dpmiller
When trying to upload a .jpg file that is over the upload_max_filesize limit set on my server I get the following error and the filesize shows to be zero:

Warning: copy() [function.copy]: Filename cannot be empty...

My php settings are:
post_max_size 8M
upload_max_filesize 2M

My php code checks for file sizes over 1M and works if the filesize is under 2M but if they are over 2M I get the php error message mentioned above and again the filesize shows to be zero.

Does anyone know how to test for this so the error message does not appear?

Any help would be greatly appreciated.

Thanks.

Re: File upload exceeds upload_max_filesize

Posted: Tue May 25, 2010 9:50 pm
by requinix
One of the first things your script needs to check is for errors.

Re: File upload exceeds upload_max_filesize

Posted: Tue May 25, 2010 11:03 pm
by dpmiller
Thank you tasairis that helped alot. As you can tell I am a bit of a newbie.