Dear all,
I have exists excel file on server. Now, I want output the file by php. I have this code:
$file = "test.xls";
$file=basename($file);
if (file_exists($file)) {
header('Content-Type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$file);
ob_clean();
flush();
readfile($file);
exit;
}
When I click download button, I can open file, but appear "missing css file" dialog and content of this file have replaced by special character.
Anyone help me? Thank you in advanced.