title: 'PHPExcel_Reader_Exception' with message 'Could not open for reading! File does not exist.'
body: <p>I use BootstrapValidation to Validate files for PhpExcel.</p>
  
  <p><code>Fatal error: Uncaught exception 'PHPExcel_Reader_Exception' with message 'Could not open for reading! File does not exist.'</code></p>
  
  <p>1: How can i set validation to not only accept .xls but the whole filename (file.xls)?</p>
  
  <p>2: File doesn't POST? (See script)</p>
  
  <p><strong>HTML:</strong> (I need to have <code>input name ="avatar"</code> to get BootstrapValidation to work)</p>
  
  <pre><code>&lt;form id="fileForm" class="form-horizontal well" action='php/import_excel.php' method="post"&gt;
      &lt;div class="form-group"&gt;
          &lt;h4&gt;Välj fil...&lt;/h4&gt;
              &lt;div class="col-sm-12"&gt;
                  &lt;input type="file" class="form-control" id="file" name="avatar" /&gt;
              &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="pull-right"&gt;
      &lt;button type="submit" id="Import" name="Import" class="btn btn-primary button-loading" data-loading-text="Loading..."&gt;Ladda upp&lt;/button&gt;
      &lt;/div&gt;
      &lt;br /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>$(document).ready(function() {
  $('#fileForm').bootstrapValidator({
      feedbackIcons: {
          valid: 'glyphicon glyphicon-ok',
          invalid: 'glyphicon glyphicon-remove',
          validating: 'glyphicon glyphicon-refresh'
      },
      fields: {
          avatar: {
              validators: {
                  file: {
                      extension: 'xls',
                      type: 'application/vnd.ms-excel',
                      message: 'Välj: lkbkom.xls'
                  }
              }
          }
      }
  });
  });
  </code></pre>
  
  <p><strong>PHP:</strong></p>
  
  <pre><code>if(isset($_POST["Import"])){
  echo $path=$_FILES["file"]["tmp_name"];
  </code></pre>