I want to upload files with CodeIgniter through generated numbered upload fields :
<input type='file' name='field[0]' />
<input type='file' name='field[1]' />
These upload fields are among another inputs fields :
<input type='file' name='field[0]' />
<input type='TEXT' name='field[1]' />
<input type='file' name='field[2]' />
I just want to upload the files when the user click on the Submit button and keep this specific inputs structure
I've tried this but it doesn't work :
for($i=0; $i<count($_FILES); $i++)
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'jpg|jpeg|gif|png';
$config['overwrite'] = FALSE;
$this->upload->initialize($config);
$this->upload->do_upload('field['.$i.']');
}
Any help would be very appreciated! Thanks!