title: codeigniter upload path does not appear to be valid
body: <p>Problem is When upload a image its shows same error every time "The upload path does not appear to be valid". Tried so much solution but still same problem with it..Please help.</p>
  
  <p>Controller:</p>
  
  <pre><code>    public function updateprofile()
          {
              /***get current user data***/
              $this-&gt;load-&gt;model('Admin_main','userinfo');
              $data=$this-&gt;userinfo-&gt;getuserdata();
              $this-&gt;load-&gt;model('Admin_main','updateprofile');
              $result=$this-&gt;updateprofile-&gt;updatemyprofile();
              if($data-&gt;identity=='admin')
              {
               redirect('admin/myprofile'); 
              }
              else
              {
               redirect('campuser/myprofile');
              }
  
          }
  </code></pre>
  
  <p>Model:  </p>
  
  <pre><code>       if($_FILES['fileToUpload']['name']!='')
          {
                   $config["upload_path"] =  './uploads/'; 
                   $config["allowed_types"] = 'jpg|jpeg|png|gif';
                   $config['max_width'] = 0;
                   $config['max_height'] = 0;
                   $config['max_size'] = 0;
                   $config['encrypt_name'] = TRUE;
                  //Load upload library and initialize configuration
                   $this-&gt;load-&gt;library('upload',$config);
                   $this-&gt;upload-&gt;initialize($config);
                  if($this-&gt;upload-&gt;do_upload('fileToUpload')){
                      $uploadData = $this-&gt;upload-&gt;data();
                      $picture = $uploadData['file_name'];
                      $mypic = array('profile_pic'=&gt;$picture);
                      $this-&gt;db-&gt;set($mypic);
                      $this-&gt;db-&gt;where('id', $userid);
                      $uppic=$this-&gt;db-&gt;update('mokhayam_users');
                  }
                  else
                  {
                      echo $this-&gt;upload-&gt;display_errors();
                  }
              }
  </code></pre>
  
  <p>View: </p>
  
  <pre><code> &lt;form class="form-horizontal" action="admin/updateprofile" method="post" enctype="multipart/form-data"&gt;
               &lt;div class="form-group"&gt;
               &lt;label class="col-sm-2 control-label"&gt;Profile Picture&lt;/label&gt;
             &lt;div class="col-sm-10"&gt;
          &lt;label for="fileToUpload"&gt;&lt;img src="assets/admin/dist/img/gul.jpg" id="blah1" class="profile-user-img img-responsive img-circle"/&gt;&lt;/label&gt;&lt;input type="file" name="fileToUpload" id="fileToUpload" onchange="$('#blah1')[0].src = window.URL.createObjectURL(this.files[0])"&gt;
                              &lt;/div&gt;
                                &lt;/div&gt;
              &lt;input type="hidden" name="userid" value="2"&gt; 
                                &lt;div class="form-group"&gt;
                                  &lt;div class="col-sm-offset-2 col-sm-10"&gt;
     &lt;button type="submit" class="btn btn-success"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
             &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thanks in advance..    </p>