title: image upload and save path in database using codeigniter
body: <p>i did not get image upload and save <code>image</code> path in database
  My table name is <code>uploadimage</code> and controller name is <code>upload.php</code></p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class Upload extends CI_Controller {
  
  
      public function index()
      {
          $this-&gt;load-&gt;view('view');
      }
      public function do_upload()
  
      {
          $status="";
          $msg="";
          $filename='product_pic';
          if(empty($_POST['title']))
          {
              $status="error";
              $msg="plz enter title";
          }
          if($status!="error")
          {
              $config['upolad_path']='./file/';
               $config['allowed_types']='gip|jpg|png';
               $config['max_size']=1024*0;
               $config['encrypt_name']=true;
               $this-&gt;load-&gt;library('upload',$config);
               if(!$this-&gt;upload-&gt;do_upload($filename))
               {
                   $status='error';
                   $msg=$this-&gt;upload-&gt;display_errors('','');
               }
               else
               {
                   $this-&gt;load-&gt;model('file_model');
                   $data=$this-&gt;upload-&gt;data();
                   $file_id=$this-&gt;file_model-&gt;insert_file($data['file_name'],$_POST['title']);
                   if($file_id)
                   {
                       redirect('Upload/view');
                   } 
           }
      }
  </code></pre>