title: pulling my hair on codeigniter upload
body: <p>So I keep getting an error saying that I did not choose a file to upload. I followed the codeigniter's site example, and searched a lot of topics with no success. PLease help me identify what I'm missing or doing wrong. It's just a simple upload of an xml that is like couple kb's.</p>
  
  <p>The controller:</p>
  
  <pre><code>&lt;? if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
  class upload extends CI_Controller{
  
      function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;helper(array('form', 'url'));
      }
  
      function index(){
  
          $this-&gt;load-&gt;view("uploadPage", array('error'=&gt;''));
  
      }
  
      function theUpload(){
          echo "uploading";
          $config['upload_path'] = "./uploads/";
          $this-&gt;load-&gt;library('upload', $config);
  
          if(!$this-&gt;upload-&gt;do_upload('userfile')){
              $error=array('error'=&gt;$this-&gt;upload-&gt;display_errors());
              $this-&gt;load-&gt;view("uploadPage", $error);
              echo "no upload";
          } else{
              echo "file uploaded";
  
          }
      }       
  }
  ?&gt;
  </code></pre>
  
  <p>The HTML:</p>
  
  <pre><code>&lt;body&gt;
  
      &lt;?php echo $error;?&gt;
      &lt;?php echo form_open_multipart('upload/theUpload');?&gt;
      &lt;input type="file" name="userfile" id="userfile"/&gt;
      &lt;input type="submit" name="submit" value="Upload File"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>If it helps, here's my htaccess</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /kayokee/ci/
  #Additionally this will allow you to create a System.php controller,
  #previously this would not have been possible.
  #’system’ can be replaced if you have renamed your system folder.
  RewriteCond %{REQUEST_URI} ^system.*
  RewriteRule ^(.*)$ /index.php?/$1 [L]
  
  #When your application folder isn’t in the system folder
  #This snippet prevents user access to the application folder
  #Submitted by: Fabdrol
  #Rename ’application’ to your applications folder name.
  RewriteCond %{REQUEST_URI} ^application.*
  RewriteRule ^(.*)$ /index.php?/$1 [L]
  
  #Checks to see if the user is attempting to access a valid file,
  #such as an image or css document, if this isn’t true it sends the
  #request to index.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
  &lt;/IfModule&gt;
  
  &lt;IfModule !mod_rewrite.c&gt;
  # If we don’t have mod_rewrite installed, all 404′s
  # can be sent to index.php, and everything works as normal.
  # Submitted by: ElliotHaughin
  
  ErrorDocument 404 /index.php
  &lt;/IfModule&gt;
  </code></pre>