I am trying to upload multiple videos, through form but my php file is saying its not set
i have increased my max upload to 500m and i included enctype but it still does the same thing
html
<form action="apps/course/uploadvideo.php" method="post" enctype="multipart/form-data">
<input style="display: none" type="file" name="videos[]" id='video1' multiple="multiple" accept=".mov,.mp4" />
<input style="display: none" type="file" name="videos[]" id='video2' multiple="multiple" accept=".mov,.mp4" />
<input style="display: none" type="file" name="videos[]" id='video3' multiple="multiple" accept=".mov,.mp4" />
<input type="submit" value="Submit Videos" class="btn btn-primary btn-user btn-block">
</form>
php code
if(isset($_FILES['videos'])){
$name_array = $_FILES['videos']['name'];
$tmp_name_array = $_FILES['videos']['tmp_name'];
$type_array = $_FILES['videos']['type'];
$size_array = $_FILES['videos']['size'];
$error_array = $_FILES['videos']['error'];
for($i = 0; $i < count($tmp_name_array); $i++){
if(move_uploaded_file($tmp_name_array[$i],
"../../../../upload/".$name_array[$i])){
echo $name_array[$i]." upload is complete<br>";
} else {
echo "move_uploaded_file function failed for ".$name_array[$i]."<br>";
}
}
}
after var dumping it outputs this array (size=0) empty
I expect it to move to the required folder