title: SpreadSheet - Uncaught InvalidArgumentException: File "file.xlsx" does not exist
body: <p>I am uploading an xlsx file in a folder and later reading it to insert the information into the database, however the spreadsheet plugin is not finding the file, it is going to a folder that does not make sense, below is code that I'm using.</p>
  
  <p>The correct file path is: arquivosRetorno/file.xlsx
  but he is looking for in PHP Fatal error:  Uncaught InvalidArgumentException: File "file.xlsx" does not exist. in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php:137</p>
  
  <pre><code>$allowed_extension = array('xls', 'csv', 'xlsx');
  $file_array = explode(".", $_FILES["arquivo"]["name"]);
  $file_extension = end($file_array);
  if(in_array($file_extension, $allowed_extension)){
      $file_name = time() . '.' . $file_extension;
      move_uploaded_file($_FILES['arquivo']['tmp_name'], 'arquivosRetorno/'.$file_name);
  
      $file_type = \PhpOffice\PhpSpreadsheet\IOFactory::identify($file_name);
      $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($file_type);
  
      $spreadsheet = $reader-&gt;load($file_name);
      unlink($file_name);
      $data = $spreadsheet-&gt;getActiveSheet()-&gt;toArray();
      foreach($data as $row){
          if($row[5] &gt; 0){
              $numeroIdentificacaoContribuicoes = $row[5];
              $situacao = trim($row[7]);
              $dataBaixaLiquidacao = trim($row[2]);
              $dataPedacos = explode("/",$dataBaixaLiquidacao);
              $dataBD = $dataPedacos[2]."-".$dataPedacos[1]."-".$dataPedacos[0];
              if($row[5]&gt;40107){
                  if ($numeroIdentificacaoContribuicoes != null || $numeroIdentificacaoContribuicoes != '') {
                      $bd-&gt;SQL = "SELECT * FROM entradas WHERE id2 = ".$numeroIdentificacaoContribuicoes;
                      $bd-&gt;Executa();
                      $status = $bd-&gt;Regs[0]["status"];
                      if ($situacao == 'Liquidado') {
                          if($status == "" || $status == "boleto nao foi pago" || $status == null){
                              $bd-&gt;SQL = "UPDATE entradas SET status = 'boleto pago', data_boleto = '".$dataBD."' WHERE id2 = ".$numeroIdentificacaoContribuicoes."";
                              $bd-&gt;Executa();
                              $bd2-&gt;SQL = "UPDATE transacoes SET status_transacao = '9995' WHERE numeropedido = ".$numeroIdentificacaoContribuicoes."";
                              $bd2-&gt;Executa();
                          }
  
                      }else{
                          if($status != "boleto pago"){
                              $bd-&gt;SQL = "UPDATE entradas SET status = 'boleto nao foi pago', data_boleto = '".$dataBD."' WHERE id2 = ".$numeroIdentificacaoContribuicoes."";
                              $bd-&gt;Executa();
                              echo "&lt;br&gt;";
                              echo $bd2-&gt;SQL = "UPDATE transacoes SET status_transacao = '9994' WHERE numeropedido = ".$numeroIdentificacaoContribuicoes."";
                              $bd2-&gt;Executa();
                          }
                      }
                  }       
             }
          }
      }
      $message = '&lt;div class="alert alert-success"&gt;Arquivo importado com sucesso&lt;/div&gt;';
  }else{
      $message = '&lt;div class="alert alert-danger"&gt;Apenas arquivos .xls .csv or .xlsx são aceitos&lt;/div&gt;';
  }
  </code></pre>