title: Files not getting stored in correct folder
body: <p>I have a form in CodeIgniter that allows the user to upload 2 separate files. At the backend I want these files to get stored in the different folder. In the controller i have written the upload code</p>
  
  <pre><code>public function upload()
      {
          /**Start uploading file**/
          $config['upload_path'] = './assets/file/.';
          $config['allowed_types'] = 'gif|jpg|png|doc|txt';
          $config['max_size'] = 1024 * 8;
          $config['encrypt_name'] = TRUE;
  
          $this-&gt;load-&gt;library('upload', $config);
  
          if (!$this-&gt;upload-&gt;do_upload('file')) 
              {
                $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
                echo $error;
  
              }
          else
              {
                $data = $this-&gt;upload-&gt;data();
                echo $file = $data['file_name']; //name of  file
  
              }
  
          /**End uploading file**/
  
          /**Start uploading img**/
  
          $config2['upload_path'] = './assets/img/.';
          $config2['allowed_types'] = 'gif|jpg|png|doc|txt';
          $config2['max_size'] = 1024 * 8;
          $config2['encrypt_name'] = TRUE;
  
          $this-&gt;load-&gt;library('upload', $config2);
  
          if (!$this-&gt;upload-&gt;do_upload('img')) 
              {
                $error1 = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
                echo $error1;
  
              }
          else
              {
                $data1 = $this-&gt;upload-&gt;data();
                echo $img = $data1['file_name']; //name of  img
  
              }
  
          /**End uploading img**/
      }
  </code></pre>
  
  <p>The images are getting uploaded but they are getting uplaoded to same folder. Can anyone please tell how i can make the files get saved in seperate folders</p>