title: Code Igniter File Upload - No File Type
body: <p>I've been scouring the Code Igniter forums for the past hour trying to figure this one out:</p>
  
  <p>I'm writing a file upload handler for a web application using Code Igniter. I have the following code to handle the upload so far:</p>
  
  <pre><code>public function send() {        
      $config = array(
          'upload_path' =&gt; 'path/to/my/upload/directory',
          'allowed_types' =&gt; 'pdf'
      );
  
      $this-&gt;load-&gt;library('upload', $config);
  
      $this-&gt;upload-&gt;do_upload('pdf_upload');
  
      echo "&lt;pre&gt;";
      print_r($this-&gt;upload-&gt;data());
      echo "&lt;/pre&gt;";
      exit();
  }
  </code></pre>
  
  <p>And my view:</p>
  
  <pre><code>&lt;?= $errors ?&gt; &lt;br /&gt;
  &lt;?= form_open_multipart('/Upload_test/send') ?&gt;
      &lt;p&gt;&lt;label for="pdf_upload"&gt;File: (PDF ONLY)&lt;/label&gt; &lt;input type="file" name="pdf_upload" id="pdf_upload" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;input type="submit" /&gt;&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When I submit the form with a valid PDF file selected, I get the following output from <code>print_r()</code>:</p>
  
  <pre><code>Array
  (
      [file_name] =&gt; my_file.pdf
      [file_type] =&gt; 
      [file_path] =&gt; path/to/my/upload/directory/
      [full_path] =&gt; path/to/my/upload/directory/my_file.pdf
      [raw_name] =&gt; my_file
      [orig_name] =&gt; 
      [client_name] =&gt; my_file.pdf
      [file_ext] =&gt; .pdf
      [file_size] =&gt; 4190
      [is_image] =&gt; 
      [image_width] =&gt; 
      [image_height] =&gt; 
      [image_type] =&gt; 
      [image_size_str] =&gt; 
  )
  </code></pre>
  
  <p><strong>The file type is blank.</strong> What could be causing this? What am I missing?</p>