PHP File Upload error code

Source: Internet
Author: User

Attention:

1, upload the file, in the HTML form form must be labeled:enctype= ' Multipart/form-data '

2, there is a saying, the request must be in the form form, in front of the FILE with hidden fields such as:<input type=hidden name= ' max_file_size ' value= ' value ' >

File Upload error code:

  Predefined variable $_files array has 5 contents:  
    $_files[' userfile ' [' Name ']--the original name of the client machine file   The  MIME  type of
    $_files[' userfile ' [' type ']--file  
     $_files[' userfile ' [' Size ']--uploaded file sizes in bytes  
    $_files[' userfile '] [' Tmp_ Name ']--file is uploaded after the temporary file name stored on the server  
    $_files[' userfile '] ' error ']--and the file upload related error code  

  where $_files[' userfile ' [' ERROR '] can have the following values and meanings:  
    0--No error occurred and the file upload was successful.    does not have to really have files uploaded, it is possible that you see that size is 0.
    1--uploaded a file that exceeds the value of the  upload_max_filesize  option limit in  php.ini .   .
    2--the size of the uploaded file exceeds the value specified by  MAX_FILE_SIZE  option in the  HTML  form.    The
    3--file is only partially uploaded.   
    4--no files were uploaded.   refers to the form's file field without content, which is an empty string.
     
     

Recommended reading: PHP File upload error code

PHP File Upload error code

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.