upload 2 file in different directory codeigniter code example
Example: how to upload two files on same form different path in codeigniter
if($this->input->post('Submit')){
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'jpg|jpeg|bmp|png';
$config['max_size'] = '30720';
$config['encrypt_name'] = TRUE;
$this->load->library('upload', $config);
$this->upload->do_upload('userfile');
$video_upload=$this->upload->data();
$config2['upload_path'] = './thumb/';
$config2['allowed_types'] = 'jpg|jpeg|bmp|png';
$config2['max_size'] = '30720';
$config2['encrypt_name'] = TRUE;
$this->upload->initialize($config2);
$this->upload->do_upload('txt_thumb');
$thumbnail_upload=$this->upload->data();
$date=date("d-m-Y");
$data = array(
'parent_id'=> $this->input->post('txt_parent'),
'cat_id' => $this->input->post('txt_category'),
'title'=> $this->input->post('txt_title'),
'status' => $this->input->post('txt_status'),
'featured' => $thumbnail_upload['file_name'],
'image' => $video_upload['file_name'],
'time'=>$date
);
$sql_ins= $this->Insimage->insertimage($data);
if($sql_ins)
{
$data['Success'] = "Image has been succesfully inserted!!";
}