Good afternoon, I have a script that generates an excel spreadsheet with information, but after the exchange the server started to give problem, before it generated and dropped normally but now only saved on the server the file perfectly. But instead of downloading the file opens a page with coding defects. here is the part of the code that should be downloaded.
header('Content-Type: application/vnd.ms-excel'); //mime type
header('Content-Disposition: attachment;filename="'.$filename.'"'); //tell browser what's the file name
header('Cache-Control: max-age=0'); //no cache
readfile("download/".$filename);
exit();