title: Uploading files in codeigniter
body: <p><strong>A Problem was encountered while attempting to move the uploaded file to the final destination</strong></p>
  
  <p><strong>Unable to upload the file in codeigniter using their upload class</strong>, upload directory is also exist, 
  below is a code</p>
  
  <pre><code>$config = array(
                  'upload_path' =&gt; './upload_dir/users_docs/',
                  'allowed_types' =&gt; 'gif|png|jpeg',
                  'max_size' =&gt; 0,
                  'max_width' =&gt; 0,
                  'max_height' =&gt; 0,
                  'file_name' =&gt; $this-&gt;currTime,
          );
          $this-&gt;load-&gt;library('upload', $config);
          if (!empty($_FILES['company_logo']['name']) &amp;&amp; !$this-&gt;upload-&gt;do_upload('company_logo')) {
              $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
              $this-&gt;session-&gt;set_flashdata('error_message', $error['error']);
              redirect('home');
          }
          $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
  </code></pre>