title: File upload not working in codeigniter
body: <p>i am a beginner at codeigniter. since past 2 days i've been trying to build a file upload system using CI's guide. The problem is that the images are not getting uploaded in the upload directory <strong>./uploads/</strong> I suspect that the problem lies with the permissions of the upload folder but i am not sure. I am building the application locally using XAMPP on Windows 7. after pushing the upload button, nothing happens. (it is supposed to either show display errors or redirect to a success page.)</p>
  
  <p>View- upload_form.php
     `
      </p>
  
  <pre><code>    &lt;title&gt;Upload Form&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form&gt;
  
  &lt;?php
  echo $error;
  ?&gt;
  
  &lt;?php echo form_open_multipart('upload/do_upload'); ?&gt;
  &lt;input type='file' name='userfile' size='20' /&gt;
  &lt;br /&gt;&lt;br /&gt;
  
  &lt;input type='submit' value='upload' /&gt;
  &lt;/form&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>success page - upload_success.php</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  &lt;title&gt;Upload Form&lt;/title&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
  
  &lt;h3&gt;Your file was uploaded successfully&lt;/h3&gt;
  
  &lt;ul&gt;
  
  &lt;?php foreach ($upload_data as $item =&gt; $value): ?&gt;
  &lt;li&gt;&lt;?php echo $item; ?&gt;: &lt;?php echo $value; ?&gt;&lt;/li&gt;
  &lt;?php endforeach; ?&gt;
  
  &lt;/ul&gt;
  
  &lt;p&gt; &lt;?php echo anchor('upload' , 'Upload Another File!'); ?&gt; &lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>controller - upload.php</p>
  
  <pre><code>&lt;?php
  
  class Upload extends CI_Controller{
  
  
  function __construct()
  {
  
      parent::__construct();
      $this-&gt;load-&gt;helper(array('form' , 'url'));
  }
  
  function index(){
  
      $this-&gt;load-&gt;view('upload_form' , array('error' =&gt; ''));
  }
  
  
  function do_upload()
  {
  
  
      $config['upload_path'] = './uploads/';
      $config['allowed_types'] = 'gif|png|jpg|jpeg' ;
      /*$config['max_size'] = '100';
      $config['max_width'] = '1024';
      $config['max_height'] = '768';*/
  
  
  $this-&gt;load-&gt;library('upload' , $config);
  
  if (! $this-&gt;upload-&gt;do_upload())
  
   {
  
      $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
  
      $this-&gt;load-&gt;view('upload_form' , $error); //show error page
  }
  
  else
  {
  
  
      $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
  
      $this-&gt;load-&gt;view('upload_success' , $data);
  }
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>routing - routes.php</p>
  
  <pre><code>$route['default_controller'] = 'welcome';
  $route['404_override'] = "";
  
  $route['(:any)'] = "upload";
  </code></pre>