[eluser]Mistry007[/eluser]
hi i am having trouble while uploading multiple file.
here are my code
Code:
if($this->input->post('btnUpload'))
{
$this->load->library('upload');
$totalfiles = count($_FILES['userfile']['name']);
for($i=0; $i < $totalfiles; $i++)
{
$config['file_name'] = 'test_'.$i;
$config['upload_path'] = $this->uploadpath;
$config['allowed_types'] = 'jpg|jpeg|gif|png';
$config['max_size'] = '10000';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$config['overwrite'] = FALSE;
$this->upload->initialize($config);
if($this->upload->do_upload())
{
$file_data = $this->upload->data();
}else
{
$error = array('error' => $this->upload->display_errors());
print_r($error);
}
}
}
Note :- It will display error that "You did not select a file to upload."
Can Any one help me out ?