With following code I tried to upload image and video file at the same time but, image file is uploading & video file is not uploading
<form class="pure-form pure-form-aligned" action="Processor.php" method="post" enctype="multipart/form-data" >
<fieldset>
<div class="pure-control-group">
<label for="image">Upload image</label>
<input type="file" name="image" class="pure-input-1-4" />
</div>
<div class="pure-control-group">
<label for="video">Upload video</label>
<input type="file" name="video" class="pure-input-1-4" />
</div>
</fieldset>
<div class="pure-controls">
<input type="submit" name="submit" value="Submit" class="pure-button pure-button-primary" />
</div>
</form>
php
$target1 = "../image/";
$target2 = time() . rand(11, 99). basename( $_FILES['image']['name']) ;
$target3 = $target1 . $target2;
$target4 = "../video/";
$target5 = time() . rand(11, 99). basename( $_FILES['video']['name']) ;
$target6 = $target4 . $target5;
if(move_uploaded_file($_FILES['image']['tmp_name'], $target3))
{
echo "The file “". basename( $_FILES['image']['name']). "” has been uploaded <br>";
}
else
{
echo "Sorry, there was a problem uploading your file.\n <br>";
}
if(move_uploaded_file($_FILES['video']['tmp_name'], $target6))
{
echo "The file “". basename( $_FILES['video']['name']). "” has been uploaded <br>";
}
else
{
echo "Sorry, there was a problem uploading your file.\n <br>";
}