title: image upload in codeigniter
body: <p>I am trying to upload image in codeigniter in localhost.But the image is not get uploaded.Is there any changes in the config file needed.The controller I have used is shown below...</p>
  
  <pre><code>&lt;?php
  
  class upload extends CI_Controller
  {
      public function __construct()
      {
          parent::__construct();
  
          $this-&gt;load-&gt;helper(array(
              'url',
              'form',
              'html'
          ));
      }
  
      function index()
      {
          $this-&gt;load-&gt;view('upload_form');
      }
  
      function do_upload()
      {
          $config['upload_path'] = '../uploads/';
  
          $config['allowed_types'] = 'gif|jpg|png';
          $config['max_size']      = '500';
          $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);
              $this-&gt;load-&gt;view('upload_form');
          } else {
              //$data = array('upload_data' =&gt; $this-&gt;upload-&gt;data());
  
              $this-&gt;load-&gt;view('upload_success');
          }
      }
  
  }
  ?&gt;
  </code></pre>