Hi i am building a multiple pic uploader and i have some questions.
i have 9 file inputs, well i have one but i put it in a while loop so it does it 9 times.
But if someone only uses 1 of the inputs it still builds an array of 9, 1 has data and the other 8 have zip.
How do i get just the one input in the array, and only load what they use?
here is the input while loop
there is a table started up here
while($c <= 9)
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" size="20" class="inputf" />
<?=$c;?>) <input type="file" name="uimages" id="uimages" size="20" class="inputf" />
<input type="text" value="Title" name="title" />
and then table closes here when its done looping and also the submit is down here as well.
And then my other question is how do i grab each one on the php side, i like this format because it processes one at a time instead of all at once. So it saves me the hassle of my max upload issue.
here is my foreach on the php side.
when this was a single upload process it used the word "file" as the name in the input.
i changed it in the input form to the array uimages
so when you look at this alot of it is original, i just changed the name
from file to uimages and added the foreach loop, which im sure is wrong.
I think i have to address each one as [key] right?
foreach($_FILES["uimages"]["name"] as $key => $value)
$item = new GalleryItem();
$aType = split("/",$_FILES['uimages']['type']);
$data = array( 'Gallery_ID' => $Gallery_ID,
'filepath' => $_FILES["uimages"]["tmp_name"],
'Type' => ucfirst(array_shift($aType)),
'SubType' => array_shift($aType),
'title' => $title,
$result = $item->Init((object)$data);
$result = $item->Save();
}//close if add