Jump to content

Multiple file upload- last image saved, 1st 3 not!


Decipher19

Recommended Posts

Hi there, I have 4 file fields in my html form.

 

However, the last image is only uploaded into the assigned directory. and the 1st 3 images was not. I have troubleshooted and found out that the last image is always saved. I'm not sure whether the images were overwritten but there were no errors at all as I have set a message saying "Image cannot be loaded". I am able to echo out the 4 image files but only the last one is always saved.

 

//i have 4 of these
<input type="file" name="uploadFile[]" id="uploadFile[]" />

 

$numoffile = 3; 
for($i=0; $i<=$numoffile; $i++)
{
$photo_name    = $_FILES['uploadFile']['name'][$i];       

$tmp_photo     = $_FILES['uploadFile']['tmp_name'][$i];
//.....more....
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.