-1

I have this script to let the user download file:

header('Content-Encoding: UTF-8');
header("Content-Type:   application/vnd.ms-excel; charset=UTF-8");
header("Content-Disposition: attachment; filename=qa_report.xlsx");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
// echo excel file ...
exit;

The file always have a BOM marker, how can't I remove the BOM marker?

Community
  • 1
  • 1
One Man Crew
  • 8,885
  • 2
  • 37
  • 50

1 Answers1

0

I solved this. The problem was not the script file encode but other include file that wasn't Encode with UTF8 without BOM. All the include files have to be with same encode.

One Man Crew
  • 8,885
  • 2
  • 37
  • 50