title: Codeigniter -> Image Uploading Part 2 -> Multiple Images
body: <p>I am trying to create a multiple image uploader and I have come across this <a href="http://taggedzi.com/articles/display/multiple-file-uploads-using-codeigniter" rel="nofollow">link</a>.  What I am confused about in relation to my code below and the link is that do I have to have 2</p>
  
  <p><code>$this-&gt;upload-&gt;do_upload();</code> functions to run my code or how do I use </p>
  
  <p><code>$this-&gt;upload-&gt;initialize($config);</code> in the below situation?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>//Image Upload Function
  
  $conceptOne = 'conceptOne';
  $conceptTwo = 'conceptTwo';
  
  $location = $_SERVER['DOCUMENT_ROOT'].'/_assets/quote/uploads/';
  
  $folderName = $this-&gt;quote-&gt;getCompanyDetails()-&gt;companyName;
  $folderName = str_replace(" ", "_", $folderName);
  $folderName = strtolower($folderName);
  
  if(!is_dir($location.$folderName))
  {   
      mkdir($location.$folderName);
      chmod($location.$folderName, 0777);
  
      //Set File Settings 
      $config['upload_path'] = $location.$folderName; 
      $config['allowed_types'] = 'jpg|png|pdf'; 
      $config['file_name'] = $conceptOne;
      $config['remove_spaces'] = TRUE;
      $config['overwrite'] = TRUE;
      $config['max_size'] = '1024'; 
      $config['max_width'] = '1024'; 
      $config['max_height'] = '768'; 
  
      $this-&gt;load-&gt;library('upload', $config); 
  
      print_r($config);
  
      if(!$this-&gt;upload-&gt;do_upload($conceptOne)) { #= try upload
          $data['uploadError'] = array('uploadError' =&gt; $this-&gt;upload-&gt;display_errors()); #Error
          $this-&gt;load-&gt;view('layout', $data);
      } // Do upload
      else{
          $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data($conceptOne));
      }// end else
  }// end if folder
  </code></pre>