注意:未定义的偏移量:第 6 行上的 3
第 6 行如下:
$tmpFilePath = $_FILES['file']['tmp_name'][$i];
这是您应该需要的一切:
session_start();
//Loop through each file
for($i=0; $i<count($_FILES['file']); $i++) {
//Get the temp file path
$tmpFilePath = $_FILES['file']['tmp_name'][$i];
//Make sure we have a filepath
if ($tmpFilePath != ""){
//Setup our new file path
$newFilePath = "./uploaded_files/" . $_FILES['file']['name'][$i];
//Upload the file into the temp dir
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
echo "Upload Successful!<br />";
}
}
}