title: filename return empty codeigniter
body: <p>i have form to upload images in php, when i save the path and name, the name returns empty field in table database here is my code and the value in my database always empty field, please help me</p>
  
  <p>Registration controller</p>
  
  <pre><code>&lt;?php
  /**
  * 
  */
  class Registration extends CI_Controller {
  
      function __construct() {
          parent::__construct();
          //$this-&gt;load-&gt;library('upload');
          $this-&gt;load-&gt;helper('form');
      }
  
      function index() {
          $this-&gt;load-&gt;view('/registration/daftar');
  
      }
  
      function add_user() {
          $this-&gt;load-&gt;model('/daftar/Daftar_Model');
          $image_path = APPPATH. 'user_images/';
          $config['upload_path']   = $image_path;
          $config['allowed_types'] = 'gif|jpg|png';
          $config['max_size']      = '500';
          $config['max_height']    = '450';
          $config['max_width']     = '450';
          //$config['encrypt_name']  = TRUE;
          $this-&gt;load-&gt;library('upload', $config);
          $this-&gt;upload-&gt;initialize($config);
          $path = $this-&gt;upload-&gt;data();
          $image_name1 = $path['file_name'];
          $image_path1 = $path['file_path'];
          //$this-&gt;upload-&gt;do_upload('foto');
          //$photo_data = $this-&gt;upload-&gt;data();
  
          $data = array(
              'username' =&gt; $this-&gt;input-&gt;post('username'),
              'password' =&gt; $this-&gt;input-&gt;post('password'),
              'email' =&gt; $this-&gt;input-&gt;post('email'),
              'no_telepon' =&gt; $this-&gt;input-&gt;post('no_telepon'),
              'alamat' =&gt; $this-&gt;input-&gt;post('alamat'),
              'image_path' =&gt; $image_path1,
              'image_name' =&gt; $image_name1
              );
  
          $this-&gt;db-&gt;select('username');
          $this-&gt;db-&gt;where('username', $data['username']);
          $result = $this-&gt;db-&gt;get('user');
  
          if($result-&gt;num_rows() &gt; 0) {
              echo "Udah ada";
              $this-&gt;output-&gt;set_header('refresh:2; url='.site_url("/registration"));
  
          } else {
              if(! $this-&gt;upload-&gt;do_upload('foto')) {
                  var_dump($this-&gt;upload-&gt;display_errors());
                  //$this-&gt;load-&gt;view('/registration/daftar', $error);
              } else {
                  //$data1 = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
                  $this-&gt;Daftar_Model-&gt;insert($data);
                  echo "Registrasi Berhasil";
                  $this-&gt;output-&gt;set_header('refresh:2; url='.site_url("/login"));
                  //$this-&gt;load-&gt;view('/registration/daftar', $data1);
              }
          }
      }
  }
  </code></pre>
  
  <p>this is my form </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Daftar&lt;/title&gt;
      &lt;body&gt;
      &lt;?php
      ?&gt;
          &lt;h1&gt;&lt;center&gt;Daftar&lt;/center&gt;&lt;/h1&gt;
          &lt;?php echo form_open_multipart('registration/registration/add_user'); ?&gt;
          &lt;center&gt;
              Username &lt;br&gt;
              &lt;input type="text" name="username"&gt; &lt;br&gt;
              Password &lt;br&gt;
              &lt;input type="password" name="password"&gt; &lt;br&gt;
              Email &lt;br&gt;
              &lt;input type="text" name="email"&gt; &lt;br&gt;
              No Telepon &lt;br&gt;
              &lt;input type="text" name="no_telepon"&gt; &lt;br&gt;
              Alamat &lt;br&gt;
              &lt;textarea name="alamat" rows="6" cols="23"&gt;&lt;/textarea&gt; &lt;br&gt;
              &lt;/form&gt;
              Foto
              &lt;input type="file" name="foto"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
              &lt;input type="submit" name="submit" value="Daftar"&gt;
          &lt;/center&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>