Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: userc865b
Added: Dec 7, 2018 12:04 PM
Views: 1
Tags: php
download exceldoc header settings
  1. $fileName="Themen_Kundenanfragen_zum_Weiterleiten.xlsx";
  2. $filePathToDownlad = $_SERVER['DOCUMENT_ROOT']."/apps/test/$fileName" ;
  3. header('Content-Disposition: attachment; filename=' . $fileName );
  4. header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
  5. header('Content-Length: ' . filesize($filePathToDownlad));
  6. header('Content-Transfer-Encoding: binary');
  7. header('Cache-Control: must-revalidate');
  8. header('Pragma: public');
  9. readfile($filePathToDownlad);