I have a generated xls file on my server that I would like to push to the client for download but can't seem to get it working. Here is what I have so far:
$xlsFile = 'test.xls';
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=$xlsFile");
header("Content-Transfer-Encoding: binary ");
exit();
My excel file is correct and can be opened if I open it from the server but how can I push this file to the client for download?