Welcome Guest, Not a member yet? Register   Sign In
Uploading 2 files
#8

[eluser]gRoberts[/eluser]
Code:
<?

$this->load->library('upload');
foreach($_FILES as $Key => $File)
{
  if($File['size'] > 0)
  {
   $filename = $this->file_name($File['name']);
   $config['upload_path'] = './sounds';
   $config['allowed_types'] = 'mp3|wav';
   $config['file_name'] = $filename;
   $this->upload->clear();
   $this->upload->initialize($config);
   if($this->upload->do_upload($Key))
   {
    // success
   }
   else
   {
    // error
   }
  }
}
?>

You'll find that when calling do_upload without any paramaters, it will be expecting an input file with a name of "userfile".

The above will loop through each of the uploaded files and upload it accordingly (untested, but based on previous experiences, it should work).

HTH


Messages In This Thread
Uploading 2 files - by El Forum - 03-21-2012, 02:27 AM
Uploading 2 files - by El Forum - 03-21-2012, 03:00 AM
Uploading 2 files - by El Forum - 03-21-2012, 03:32 AM
Uploading 2 files - by El Forum - 03-22-2012, 05:48 AM
Uploading 2 files - by El Forum - 03-22-2012, 06:00 AM
Uploading 2 files - by El Forum - 03-22-2012, 06:19 AM
Uploading 2 files - by El Forum - 03-22-2012, 06:25 AM
Uploading 2 files - by El Forum - 03-22-2012, 08:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB