Uploading more than one file!
Posted: Wed Jul 28, 2004 10:22 pm
I am looking for a way to solve a problem which I just cannot seem to figure out. I have two upload fields where users can upload two files per time but it only uploads the first one and says, "Could not copy!" for the second. My code go's like:
It's a very simple script but cannot work it out 
Any help appreciated.
Joe
Code: Select all
if ($_FILES['file1'] != "")
{
if ($_FILES['file1']['size'] < "20000")
{
copy ($_FILES['file1']['tmp_name'], $FinalImage."/".$_FILES['file1']['name']) or die ("Could not copy file. Please try again!");
}
}
if ($_FILES['file2'] != "")
{
if ($_FILES['file2']['size'] < "20000")
{
copy ($_FILES['file2']['tmp_name'], $FinalImage."/".$_FILES['file2']['name']) or die ("Could not copy file. Please try again!");
}
}Any help appreciated.
Joe