سلام.
کد زیر را نوشتم، عکس داخل پوشه اپلود شده ولی اسم عکس داخل دیتابیس ذخیره نمیشه ( دیگر فیلدها ذخیره میشن ). لطفا کدمو نگاه بندازید:
$config['upload_path'] = './content_img';$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = 1000;
$config['max_width'] = 11024;
$config['max_height'] = 7168;
$this->load->library('upload', $config);
if(!$this->upload->do_upload('userfile')){
$error = array('error' => $this->upload->display_errors());
$this->template->load('news/create_news',$error);
}else{
$this->upload->initialize($config);
$data = $this->upload->data();
$img_intro = $data['file_name'];
//$this->upload->display_errors();
}