title: "did not select a file to upload" when uploading using codeigniter
body: <p>im trying to upload an image but it always give me "You did not select a file to upload." </p>
  
  <p><strong>My controller</strong></p>
  
  <p>
  
  <pre><code>function add()
  {
  
          $thedate=date('Y/n/j h:i:s');
          $replace = array(":"," ","/");
          $newname=str_ireplace($replace, "-", $thedate);
  
          $config['upload_path'] = './upload/';
          $config['allowed_types'] = 'gif|jpg|png|jpeg';
          $config['file_name']=$newname;
          $config['max_size'] = '100';
          $config['max_width']  = '1024';
          $config['max_height']  = '768';
  
          $this-&gt;load-&gt;library('upload', $config);
          //$this-&gt;upload-&gt;initialize($config);
          $this-&gt;load-&gt;library('form_validation');
  
          $this-&gt;form_validation-&gt;set_rules('title','title','trim|required');
          $this-&gt;form_validation-&gt;set_rules('description','Description','trim|required');
          $image1=$this-&gt;input-&gt;post('image');
  
  
       if ($this-&gt;form_validation-&gt;run()==FALSE){
  
              $this-&gt;addview();   
  
              return false;
  
          }
  
  
        if (!$this-&gt;upload-&gt;do_upload($image1)) {
  
          $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
          $this-&gt;load-&gt;view('upload_error', $error);
  
  
           }
  
         else {
          $mage=$this-&gt;upload-&gt;do_upload($image1);
  
              $data =array(
              'title'=&gt;$this-&gt;input-&gt;post('title'),
              'descrip'=&gt;$this-&gt;input-&gt;post('description'),
  
              'image' =&gt; $mage['file_name']
  
      );  
  
  
              $this-&gt;load-&gt;model('member_functions');
  
              $q=$this-&gt;member_functions-&gt;insert($data);
      }}
  </code></pre>
  
  <p>all the file requirements and the file permissions are set but i still get the that eror. can someone please tell me what am i doing wrong</p>