An error occurred while processing multiple files in php.

Source: Internet
Author: User
For more information, please refer to the following link for more information, however, an error occurred while uploading multiple files. if you do not know where the error is, please advise me.
1. Upload code
 

2. server php code
Header ('content-Type: text/html; charset = utf-8 '); $ fileArray = $ _ FILES ['file']; // obtain information about multiple FILES. note: the key name does not include [] $ upload_dir = '. /upload/'; // Save the foreach Directory of the uploaded file ($ fileArray ['error'] as $ key => $ error) {if ($ error = UPLOAD_ERR_ OK) {// PHP constant UPLOAD_ERR_ OK = 0, indicating no Upload error $ temp_name = $ fileArray ['tmp _ name'] [$ key]; $ file_name = $ fileArray ['name'] [$ key]; move_uploaded_file ($ temp_name, $ upload_dir. $ file_name); echo 'upload [file '. $ Key. '] successful!
';} Else {echo' an error occurred while uploading the [file '. $ key!
';}}

3. Error


Reply to discussion (solution)

$ FileArray = $ _ FILES ['file'] to $ fileArray = $ _ FILES ['myfile']

Thank you for solving the problem!

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.