PHP File Upload

Source: Internet
Author: User
Tags php file upload vars

1.$_files["File" ["Name"]-the name of the file being uploaded

2.$_files["File" ["type"]-the type of file being uploaded

3.$_files["File" ["Size"]-the size of the uploaded file, measured in bytes

4.$_files["File" ["Tmp_name"]-the name of the temporary copy of the file stored on the server

5.$_files["File" ["Error"]-error code caused by file upload

    1. 0: Upload Successful
    2. 1: The size of the uploaded file exceeds the PHP configuration
    3. 2: Indicates that the upload file size exceeds the value specified by the Max_file_size option in the form
    4. 3: Indicates that the file was only part of the upload
    5. 4: No files uploaded

  1. if ($_files[' up_picture '][' Error ']>0) { / /Determine if the file can be uploaded to the server
  2. Echo   "Upload error:";
  3. Switch ($_files[' up_picture '] [' ERROR ']) {
  4. Case 1:
  5. Echo   "The upload file size exceeds the configuration file specified value";
  6. Break  ;
  7. Case 2:
  8. Echo   "Upload file size exceeds the agreed value in the form";
  9. Break  ;
  10. Case 3:
  11. Echo   "Upload file not complete";
  12. Break  ;
  13. Case 4:
  14. Echo   "No files uploaded";
  15. Break  ;
  16. }

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.