When php uploads multiple images, the html file uses file to receive the file. Why is no file array generated?

Source: Internet
Author: User
If you use File [] Through var_dump ($ _ file),


Using var_dump ($ _ File)

If you use file []

Reply content:


Using var_dump ($ _ File)

If you use file []

First, you need to pass the array parameter. The parameter name must be followed[]In order to be parsed, all you must useUpload_file []As the parameter name.
Second, the file upload in the array form is not parsed into an array of files in PHP parsing (this is a BUG), but will be parsed into the result you see, in the parameter, name also becomes an array. name0] indicates the name of the first file [1] indicates the name of the second file... The same applies to parameters such as type and tmp_name. That is to say, You need to obtain the information for uploading the first file, you should obtain $ _ FILES ['upload _ file' 0], $ _ FILES ['upload _ file' [0]...
This is what happens when PHP parses file arrays.

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.