title: Codeigniter -> File Upload Path | Folder Create
body: <p>Currently I have the following:</p>
  
  <p><code>$config['upload_path'] = 'this/path/location/';</code></p>
  
  <p>What I would like to do is create the following controller but I am not sure how to attack it!!</p>
  
  <pre><code>$data['folderName'] = $this-&gt;model-&gt;functionName()-&gt;tableName;
  
  $config['upload_path'] = 'this/'.$folderName.'/';
  </code></pre>
  
  <p>How would I create the <code>$folderName?</code> dictionary on the sever?</p>
  
  <p><strong>Jamie:</strong></p>
  
  <p>Could I do the following? </p>
  
  <pre><code>if(!file_exists($folderName))
  {
  
    $folder = mkdir('/location/'$folderName);
  
     return $folder; 
  }
  else
  {
   $config['upload_path'] = $folder; 
  }
  </code></pre>