Welcome Guest, Not a member yet? Register   Sign In
Multiple file upload problem
#2

[eluser]homebwoi[/eluser]
I'm not sure but as I know File Uploading library doesn't support multiple files upload, so there is the way I solve this problem:

Code:
// Get count of files
$count = count($_FILES['pic']['name']);

// Upload each file separately
for ($i = 0; $i < $count; $i++)
{
  $_FILES['singlefile']['name'] = $_FILES['pic']['name'][$i];
  $_FILES['singlefile']['type'] = $_FILES['pic']['type'][$i];
  $_FILES['singlefile']['tmp_name'] = $_FILES['pic']['tmp_name'][$i];
  $_FILES['singlefile']['error'] = $_FILES['pic']['error'][$i];
  $_FILES['singlefile']['size'] = $_FILES['pic']['size'][$i];
      
  $this->upload->do_upload('singlefile');

  // Some actions with uploaded file
}


Messages In This Thread
Multiple file upload problem - by El Forum - 11-15-2012, 03:34 PM
Multiple file upload problem - by El Forum - 11-15-2012, 03:56 PM
Multiple file upload problem - by El Forum - 11-15-2012, 04:04 PM
Multiple file upload problem - by El Forum - 11-15-2012, 04:17 PM
Multiple file upload problem - by El Forum - 11-15-2012, 04:20 PM
Multiple file upload problem - by El Forum - 11-19-2012, 03:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB