title: CodeIgniter File upload - How to save file name and path?
body: <p>I need to save the selected file name and path to reuse it.
  When I upload a file, my code will check whether the data inside is correct. The data get implemented into the database and gets connected with an Account. If the Account don't exists but there are similar accounts, I have a table where the right account can be selected. With clicking onto the account the file should be implemented to this account.
  The problem is that I can't redirect to the upload function because , my filepath and filename has  lost.</p>
  
  <p>So I need to save this but I dont know how.</p>
  
  <p>Import View:</p>
  
  <pre><code>&lt;div class="h-ctr"&gt;
          &lt;?php    
         echo form_open_multipart('interview/import_data');
         echo form_upload('file');
         echo '&lt;br/&gt;';
         ?&gt;
      &lt;/div&gt;
      &lt;br&gt;
      &lt;div class="h-ctr"&gt;
          &lt;?php
              echo form_submit(null, 'Upload');
              echo form_close();
  
          ?&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My import_data Controler (neckline):</p>
  
  <pre><code> $config['upload_path'] = FCPATH. 'uploads/';
      $config['allowed_types'] = 'xlsx';
      $this-&gt;load-&gt;library('upload', $config);
  
      if($this-&gt;upload-&gt;do_upload('file')) {
          $data = $this-&gt;upload-&gt;data();
          chmod($data['full_path'], 0777);
      }
      else{
          if($this-&gt;upload-&gt;data('file_ext') != ".xlsx"){
              $type = $this-&gt;upload-&gt;data('file_ext');
              if(!empty($type)){
                  $error = '&lt;b&gt;Incorrect filetype: "'. $type.'"!&lt;/b&gt;';
              }
              else{
                  $error = '&lt;b&gt;No file selected!&lt;/b&gt;';
              }
          }
          $this-&gt;notification-&gt;set("Error!", "Interview could not be imported. Reason: $error");
          redirect('interview/import');
      }   
  
      $this-&gt;load-&gt;library('excel');
  </code></pre>
  
  <p>My view with the similar customers:</p>
  
  <pre><code>&lt;div class="h-ctr"&gt;
  
  &lt;ul class="content-list"&gt; 
      &lt;?php foreach($similaraccount as $simacc){ ?&gt;
      &lt;a class="content-list-item" href="&lt;?php echo site_url("interview/import_data/"); ?&gt;" &gt;
          &lt;li class="media"&gt;
              &lt;div class="media-body"&gt;
  
                  &lt;div class="media-heading"&gt;&lt;?php echo $simacc-&gt;name; ?&gt;&lt;/div&gt;
                  &lt;div class="media-hint"&gt;&lt;?php echo $simacc-&gt;region; ?&gt;&lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/li&gt;
      &lt;/a&gt;
      &lt;?php } ?&gt;
  </code></pre>
  
  <p></p>