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

[eluser]homebwoi[/eluser]
If you want to know which file is faulty one you can add some code into cycle:

Code:
// 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];
      
  if ($this->upload->do_upload('singlefile'))
  {
    // Some actions with uploaded file
  } else {
    echo "The error was occurred when uploading file with nubmer " . $i;
    // Or simething like that:)
  }
}

Maybe there are more efficient solutions, but I think that one is pretty simpleSmile


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