Explanation of error return values in PHP $ _ files

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.