I m trying to upload multiple photos using
<input type='file'>
with same name to the input element like,
<?php
$remainGal = $maxGallery-$totalGallery;
if($remainGal>0){
?>
<div class="businessSPGItems">
<form name="addBusinessGallery" method="post" action="businessservices.php#messageGallery" enctype="multipart/form-data">
<input type="hidden" name="businessID" value="<?php echo $businessID;?>" />
<?php
for($i=0; $i<$remainGal; $i++){
?>
<input type="file" name="filePhotos[]" style="margin-top:5px;" tabindex="<?php echo $i+5; ?>" /><br />
<?php
}
?>
<input type="submit" name="btnAddGallery" value="Add" style="margin-top:10px;" tabindex="<?php echo $i+5; ?>" />
</form>
</div>
<?php
}
?>
But the problem is when i m taking the total count of the file element it always shows 5…
ie.,
<?php
$photos = $_FILES["filePhotos"];
echo count($photos);
?>
So i could not upload more than 5 photos at a time….
i dont know i m doing the correct method..
help please,,
thanks…
Your
$_FILES["filePhotos"];will have an array of values.Read: http://php.net/manual/en/features.file-upload.multiple.php
Also note that there is an upload limit config value.
http://php.net/manual/en/ini.core.php#ini.max-file-uploads
It defaults to 20.