When PHP is uploading multiple images, the HTML file uses file to receive the files why the file array is not generated

Source: Internet
Author: User


by Var_dump ($_file)

If you use file[]

Reply content:


by Var_dump ($_file)

If you use file[]

First, you pass an array parameter, and the parameter name must be preceded by [] a normal parse, all of which you have to use upload_file[] as the parameter name.
Second, the array form of file upload, in PHP parsing is not parsed into a file array (this is called the existence of a bug), but will be parsed into the results you see, in the parameter name has become an array, NAME0] represents the first file name Name[1] Indicates the name of the second file ..., and the type, tmp_name, and other parameters are the same, that is, you want to get the information to upload the first file, you get the $_files[' upload_file ' 0], $_files[' upload_file ' [ 0] ...
Helpless PHP parsing file array is like this, this is often spit slot

Name= "upload_file[]"

  • 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.