title: file_get_contents() expects parameter 1 to be a valid path
body: <p>My image is uploading to images/news successfully. I want to now save that image in the database. but it keeps giving me the above error. My model query is correct because i use it to insert other data and it works. </p>
  
  <p>How can i save the image into the database once the user clicks submit? </p>
  
  <p>My controller:</p>
  
  <pre><code> function news()
  {
  
   $config = array(
  'upload_path' =&gt; "./images/news",
  'allowed_types' =&gt; "gif|jpg|png|jpeg|JPG",
  'overwrite' =&gt;False,
  'max_size' =&gt; "2048000", 
  'max_height' =&gt; "768",
  'max_width' =&gt; "1024"
  );
      $this-&gt;load-&gt;library('upload', $config);
  
      $this-&gt;load-&gt;helper(array('form', 'url'));
  
      if($this-&gt;upload-&gt;do_upload())
  {
  $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
   $this-&gt;load-&gt;view('manage_news',$data);
  }
  else
   {
   $message2 = "Please choose another file type. gif,jpg,png,jpeg,pdf ";
           echo "&lt;script type='text/javascript'&gt;alert('$message2');   &lt;/script&gt;";                 
            redirect('resetPasswordController/add_news', 'refresh');
         }
  
          $this-&gt;db-&gt;trans_start();
  
          $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
  
          $data = array(          
              'image' =&gt; file_get_contents( $data )
              );
  
           $this-&gt;load-&gt;model('users_model'); 
          $this-&gt;users_model-&gt;insert($data);    
  
          $this-&gt;db-&gt;trans_complete();
          $this-&gt;db-&gt;trans_complete();
  
          redirect('resetPasswordController/manage_news', 'refresh');
    }
  </code></pre>
  
  <p>my view:</p>
  
  <pre><code> &lt;?php echo form_open_multipart('resetPasswordController/news');?&gt;
   &lt;label&gt;Image&lt;/label&gt;
  &lt;input name = "userfile" type="file" /&gt;
  </code></pre>
  
  <p>my model:</p>
  
  <pre><code> function insert($data){
          $this-&gt;db-&gt;insert('news',$data);
          return $this-&gt;db-&gt;insert_id();
  }
  </code></pre>