PHP Multiple File Array

前端 未结 6 1207
陌清茗
陌清茗 2020-12-03 09:29

I have the following code which works and uploads but it will not cycle through the array to upload every file, just the first file.

6条回答
  •  暖寄归人
    2020-12-03 09:42

    you can use my updated code and as per my demo it is working perfect for multiple file upload

      $tmp_name)
    {
        $file_name = $key.$_FILES['documents']['name'][$key];
        $file_size =$_FILES['documents']['size'][$key];
        $file_tmp =$_FILES['documents']['tmp_name'][$key];
        $file_type=$_FILES['documents']['type'][$key];  
        move_uploaded_file($file_tmp,"galleries/".time().$file_name);
    }
    }else{
    echo "";
     echo "File:";
    
     echo "";
    }
    ?>
    

提交回复
热议问题