title: Laravel Upload File Mime type error
body: <p>I got some errors with the following code, I searched a lot but I didn't get the solution. I want to upload file.xls, am I wrong? Thanks</p>
  
  <p>My HTML Form:</p>
  
  <pre><code> &lt;form class="form-horizontal" role="form" method="post" action="{{ URL::to('doc/test') }}" enctype="multipart/form-data"&gt;
    &lt;input style='width:400px;' type='file' id='files'  name='files[]' class="form-control" multiple='multiple'&gt;
    &lt;button type="submit" class="btn btn-primary"&gt;Save&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My Controller Function</p>
  
  <pre><code>public function uploadDocs()
          {
              $files = Input::file('files');
              $errors = "";
              foreach($files as $file) 
              {
                $rules = array('file' =&gt; 'mimes:png,gif,jpeg,pdf,doc,docx,xls,xlsx,max:1000000'); //'required|mimes:png,gif,jpeg,txt,pdf,doc'
                $validator = Validator::make(array('file'=&gt; $file), $rules);
                if($validator-&gt;passes())
                {
                  $destinationPath = 'documents';
                  $filename = $file-&gt;getClientOriginalName();
                  $temp = explode(".", $filename);
                  $extension = end($temp);
                  $filename = $temp[0].'_'.date('Y-m-d H:i:s').$extension;
                  $upload_success = $file-&gt;move($destinationPath, $filename);
                } 
                else 
                {
                  return Redirect::back()-&gt;withErrors($validator);
                }
              }
  
          }
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>The file must be a file of type: png, gif, jpeg, pdf, doc, docx, xls, xlsx, max:1000000.
  </code></pre>