There is a lot that can go wrong during a file upload. PHP returns apropriate error messages beside the usual warnings. The error message can be found in the ["error"] segment of the array that is created during the file upload. This is either $userfile["error"] if register_globals is turned on in php.ini, or $HTTP_POST_FILES["userfile"]["error"] for PHP versions before 4.1.0, or at last and mostly recommended $_FILES["userfile"]["error"].
Value: 1; the uploaded file exceeds the upload_max_filesize directive that is specified in php.ini.
Value: 2; the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.
Value: 3; the uploaded file was only partially uploaded.
Value: 4; no file was uploaded.
Value: 5; the uploaded file has a size of 0 (read: zero) bytes.