title: php download excel file
body: <p>I write php code downloading excel file, when I test it on my localhost everything fine, the file can be open, however when I go to my server and I test the code, the file is no more readable. Here is my code</p>
  
  <pre><code>$file = basename($path);
  
  if(file_exists($path)){
  
          header("Pragma: public");
          header("Expires: 0");
          header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
          header("Cache-Control: private",false);
          header("Content-Description: File Transfer");
          header("Content-Disposition: attachment; filename=\"$file\"");
          header("Content-Type:  application/vnd.ms-excel");
          header("Content-Transfer-Encoding: binary");
          header("Content-Length: ".filesize($path));
          readfile($path);
        exit;
  }
  </code></pre>
  
  <p>for the envir , I use PHP Version 7.2.19 in local and 7.0.33 in my server, and I try all the content-type that i found but no one work . </p>