title: Image not resize and upload in Codeigniter PHP
body: <p>I am trying to create thumbnail(resize) of uploaded image using codeigniter,
  But image is not uploaded in server/folder,Here is my code, Where I went wrong ?</p>
  
  <p>
  
  <pre><code>if (isset($_FILES['image'])) {
      if (file_exists($_FILES['image']['tmp_name']) || is_uploaded_file($_FILES['image']['tmp_name'])) {
  
          $filename         = time() . uniqid(rand()) . $_FILES['image']['name'];
          move_uploaded_file($_FILES["image"]["tmp_name"], "vendorProfile/" . $filename);
          $saveArr['image'] = $filename;
          $this-&gt;load-&gt;library('image_lib');
  
          $source_paths = base_url() . 'vendorProfile/' . $filename;
          $source_path  = $_SERVER['DOCUMENT_ROOT'] . '/Profile/vendorProfile/' . $filename;
          $target_path  = $_SERVER['DOCUMENT_ROOT'] . '/Profile/vendorProfile/thumb';
  
          $config_manip = array(
              'image_library'  =&gt; 'gd2',
              'source_image'   =&gt; $source_path,
              'new_image'      =&gt; $target_path,
              'maintain_ratio' =&gt; TRUE,
              'create_thumb'   =&gt; TRUE,
              'thumb_marker'   =&gt; '_thumb',
              'width'          =&gt; 150,
              'height'         =&gt; 150
          );
  
          $this-&gt;load-&gt;library('image_lib', $config_manip);
          if (!$this-&gt;image_lib-&gt;resize()) {
              echo $this-&gt;image_lib-&gt;display_errors();
          } else {
              echo "image is uploaded";
          }
          $this-&gt;image_lib-&gt;clear();
      } 
  }       
  </code></pre>