multiple file upload errors
Hiya
I have a multiple file upload form, input defined by:
for($i = 0; $i<5; $i++)
{ echo"<......<td><input type=file name='userfile[".($i+1)."]'></td>.....";
}
and the receiving code needs to accept that maybe only one file has been chosen. anyways, i tried this:
$uploaddir = "CustomerPics2/" . $customer_id . "/" .$orderid ."/";
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
while($_FILES['userfile'][$i]&&$_FILES['userfile'][$i]!='none'){
move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $uploadfile);
}
as I thought the while statement would take care of the blank fields.
nonetheless, its not working.
all help gratefully welcomed :)
Cheers,
Laurie
|