title: how to get upload file name in codeigniter
body: <p>Hi i'm trying to upload image to a folder and image name in  database</p>
  
  <p>in view</p>
  
  <pre><code>echo form_open_multipart('subscribers_c/actioncreate',array('class'=&gt;'form'));`enter code here`
  &lt;input type='file' name='img'&gt;
  </code></pre>
  
  <p>in controller</p>
  
  <pre><code>$config['upload_path'] ='./assets/uploads/subscribers_photos'; //The path where the image will be save
          $config['allowed_types'] = 'gif|jpg|png'; //Images extensions accepted
          $config['max_size']    = '2048'; 
          $config['max_width']  = '1024'; 
          $config['max_height']  = '768'; 
          $config['overwrite'] = TRUE; 
          $this-&gt;load-&gt;library('upload', $config); //Load the upload CI library
          if (!$this-&gt;upload-&gt;do_upload('img'))
          {
              $uploadError = array('upload_error' =&gt; $this-&gt;upload-&gt;display_errors()); 
              //$this-&gt;set_flashdata('msg_error', $uploadError, site_url().'/subscribers_c/actioncreate'); 
          }
          $file_info = $this-&gt;upload-&gt;data('img');
          $img_name = $file_info['file_name']; 
  
          $data=array(
              'chit_fund_id'=&gt;$this-&gt;input-&gt;post('cid'),
              'first_name'=&gt;$this-&gt;input-&gt;post('fname'),
              'last_name'=&gt;$this-&gt;input-&gt;post('lname'),
              'dob'=&gt;$this-&gt;input-&gt;post('bd'),
              'gender'=&gt;$this-&gt;input-&gt;post('g'),
              'contact_number'=&gt;$this-&gt;input-&gt;post('mob'),
              'address'=&gt;$this-&gt;input-&gt;post('add'),
              'email_id'=&gt;$this-&gt;input-&gt;post('eml'),
              'bid_status'=&gt;$this-&gt;input-&gt;post('b_status'),
              'user_status'=&gt;$this-&gt;input-&gt;post('u_status'),
              'image_name'=&gt;$img_name,
          );
          //print_r($data);
  </code></pre>
  
  <p>image_name is not having any value
  how to get image name .</p>