Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple file uploads

Status
Not open for further replies.

kusarigama

Technical User
Apr 24, 2002
45
DE
Hi all,

I' ve got a problem concerning multiple file uploads.
The files won't be copied to my location.

Here is a snippet of my code:

thanx in advance

Olli

..html stuff

<input name=userfile[] type=file>
<input name=userfile[] type=file>
<input name=userfile[] type=file>



while(list($key) = each($userfile))
{
if(is_uploaded_file($userfile[$key]))
{

..do something
}
}

while(list($key) = each($userfile))
{
if(empty($userfile_name[$key]))
{
continue;
}
else
{
move_uploaded_file($userfile[$key],$destination);

}
}
}
 
Try this:

copy($userfile[$key],$destination);
***************************************
Party on, dudes!
[cannon]
 
Hi,

where i wrote ... do something, there will be a folder created where the file to be copied to.
When i use:
if(empty($userfile[$key]))
{
$createfolder = 1; // ..do something
}
instead of if(is_uploaded_file ...
it will set $creatfolder to 1 even when the userfile is not set




while(list($key) = each($userfile))
{
if(is_uploaded_file($userfile[$key]))
{
$createfolder = 1; // ..do something

}
}
if(createfolder == 1)
{
// create that folder
}
 
if(!empty($userfile[$key])) // if its not empty do the following
{
$createfolder = 1; // ..do something
}else{
//nothing for the key
echo &quot;key empty&quot;;
}
***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top