I have a php form that uploads files, and all files work good the limit size is set at 7340032 bytes (7Mbs) and it works ok, however when I try to upload an image larger than 500kbs when I echo the values of the first if:
if(isset($_POST['upload']) && $_FILES['userfile']['size'] > 0){
it says the image size is 0 everytime, why would this happen? the php.ini values of post_max_size is 15M and of upload_max_filesize is 10M.
Checking if the uploaded file’s size is non-zero is not the proper way to check if an upload succeeded. There’s the
['error']parameter in there for that. An incomplete upload would still have a non-zero size, but should not be processed. A better way to check is:The error code constants are defined here.