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!