When using PHP to upload files, we will use a program to listen to the file information sent by the browser, first, the status of the file to be uploaded is determined by the different values of $ _ FILES [fieldname] ['error. $ _ FILES [fieldname] ['error'] = 0 indicates that everything is normal. For more information about other values, see the comments section of the following program, if any translation is not available, please correct me!
Switch ($ _ FILES [$ field] ['error']) {
Case 1:
// The file size exceeds the server space.
$ This-> seterror ("the file is too large (server ).");
Break;
Case 2:
// The size of the file to be uploaded exceeds the browser limit
$ This-> seterror ("the file is too large (form ).");
Break;
Case 3:
// Only part of the file is uploaded
$ This-> seterror ("the file was only partially uploaded .");
Break;
Case 4:
// The file to be uploaded is not found.
$ This-> seterror ("no file was uploaded .");
Break;
Case 5:
// The temporary folder on the server is lost.
$ This-> seterror ("the servers Temporary Folder is missing .");
Break;
Case 6:
// An error occurred while writing the file to the Temporary Folder.
$ This-> seterror ("failed to write to the Temporary Folder .");
Break;
}
From: http://hi.baidu.com/jerrycn/blog/item/f1a9ad31c476a0a35edf0eca.html