title: CSV Upload - mime types
body: <p>Hi I'm trying to upload a CSV file using the following form code:</p>
  
  <pre><code>$this-&gt;widgetSchema ['file'] = new sfWidgetFormInputFile();
  
  $this-&gt;setValidator('file', new sfValidatorFile(array(
              'required'        =&gt; true,
              'path'            =&gt; sfConfig::get('sf_upload_dir') . '/properties/csv',
              'mime_categories' =&gt; array('csv' =&gt; array('text/csv', 'application/csv', 'application/excel', 'application/vnd.ms-excel', 'application/vnd.msexcel')),
              'mime_types'      =&gt; 'csv'
  )));
  </code></pre>
  
  <p>In my action I have:</p>
  
  <pre><code>     if($request-&gt;isMethod('post'))
       {
           $propertyCsvForm-&gt;bind($request-&gt;getParameter($propertyCsvForm-&gt;getName()), $request-&gt;getFiles($propertyCsvForm-&gt;getName()));
           if($propertyCsvForm-&gt;isValid())
           {
               $this-&gt;getUser()-&gt;setFlash('success-csv', 'The CSV was successfully imported.');
           } else {
              $this-&gt;getUser()-&gt;setFlash('error-csv', 'The CSV could not be imported.');
           }
       }
  </code></pre>
  
  <p>When I try to upload a CSV I always get an error, which is the mime type is incorrect</p>
  
  <p><code>Invalid mime type (text/plain).</code></p>
  
  <p>Any ideas why?</p>
  
  <p>Thanks</p>