title: When uploading image in codeigniter the image is not saved into the path folder
body: <p>When I upload an image in Codeigniter its name is saved to the database but not in the default folder. I'am using Ajax to submit the image </p>
  
  <p>My "view" profile</p>
  
  <pre><code>  &lt;div id="timelineBackground"&gt;
  &lt;?php 
  
  {
      $image_properties = array('src' =&gt; base_url("uploads/" . $timeline_image),'width' =&gt; '1000px','height'=&gt; '400px','id'=&gt;'coverimg', 'title' =&gt; 'That was quite a night','rel'   =&gt; 'lightbox');
      //echo img($image_properties);
  
     ?&gt;
  &lt;div id="timelineselector"&gt;
  
  &lt;?php echo form_open_multipart('',["id"=&gt;"form_cover"]); ?&gt;
  &lt;input type="hidden" name="email" value="&lt;?php echo $email ;?&gt;" &gt;
  
  &lt;?php echo form_upload(["name"=&gt;"timelineimage"]); ?&gt;
  
  &lt;?php echo form_submit(["name"=&gt;"submit","value"=&gt;"Submit"]); ?&gt;
  
  &lt;?php echo form_close(); ?&gt;
  
  &lt;/div&gt;&lt;?php
  }
  ?&gt;&lt;/div&gt;
  </code></pre>
  
  <p>here is my ajax code </p>
  
  <pre><code>jQuery('#form_cover').submit(function(e){
  
          e.preventDefault();
          var formData = new FormData(this);
          var url= '&lt;?php echo base_url("user/coverimage"); ?&gt;';
          formData.value
          jQuery.ajax({
  
              type: "POST",
              url:url,
              data: formData,
              cache: false,
              contentType: false,
              processData: false,
              success: function(data)
              {
  
                $('#coverimg').attr('src',data);
              },
              error: function(data){
              //error function
              }
         });            
      });
  </code></pre>
  
  <p>my controller "user"</p>
  
  <pre><code>public function coverimage(){
  
    $config = [
        'upload_path' =&gt;    './uploads/',
        'allowed_types' =&gt;    'jpg|gif|png|jpeg',
        'max_size'            =&gt; 10000000000000,
        'max_width'            =&gt; 1024000000,
        'max_height'           =&gt; 7680000000,
                   ];
  
      $this-&gt;load-&gt;library('upload', $config);
  
    if(!$this-&gt;upload-&gt;do_upload('timelineimage')  ) {
       $post = $this-&gt;input-&gt;post();
        unset($post['submit']);
         $upload_data = $this-&gt;upload-&gt;data();
       $file_name=$_FILES['timelineimage'];
  
  
        $this-&gt;load-&gt;model('Pmodel');
        $this-&gt;Pmodel-&gt;timeline_upload_model($post,$file_name);
  
  
          $image_properties = array(
          'src'   =&gt; base_url("./uploads/" . $file_name['name']),
  
          'width' =&gt; '200px',
          'height'=&gt; '200px',
          'title' =&gt; 'That was quite a night',
          'rel'   =&gt; 'lightbox'
  );
  
         // echo img($image_properties);
  echo base_url("uploads/" . $file_name['name']);
       exit();
      }else {
  
        $upload_error = $this-&gt;upload-&gt;display_errors();
        $this-&gt;load-&gt;view('admin/add_article',compact('upload_error'));
      }
  
  }
  </code></pre>
  
  <p>my model "Pmodel"</p>
  
  <pre><code>    public function timeline_upload_model($arr,$arra)
  {
  
      $email=$arr['email'];
      $image=$arra['name'];
  
  $data=array('timelineimage'=&gt;$image);
  
   $query=$this-&gt;db-&gt;where('email',$email)-&gt;update('user_data',$data);
  
      return $query;
  
  
  
  }
  </code></pre>
  
  <p>Why does it only show the name but not the image?</p>