I have an html input field like
<form method="post" action="process.php" enctype="multipart/form-data">
<div>
<h3>Files:</h3>
<input type="file" multiple="multiple" name="image[]" />
<input type="submit" value="Upload Image" />
</div>
</form>
And I want the user to be able to upload multiple files at once. My php for this uses a loop forto cycle through all files, collect information on each of them and then load them one at a time.
for($i = 0;$image['name'][$i] == true;$i++)
{
//code
}
But it will not load more than 20, ending mistake Notice: Undefined offset: 20 in F:\www\hdp\process.php on line 39. Now, if I uploaded 5 images, that would give me Notice: Undefined offset: 5 in F:\www\hdp\process.php on line 39, but that would be normal, because he uploaded all 5 photos anyway (0,1,2,3,4). I need to upload all the photos that the user adds.
I know that downloading a large number of files at once may be a bad idea, but this is only the site administrator, and this is a photography portfolio site. Therefore, it should be able to upload many photos at once. And if this is important, they are loaded into the MySQL database.
source
share