I'm already adding the Content-Type: text/csv
header but Safari is still adding the .html extension. No other tested browsers behave this same way, all others download correctly.
File name is example.csv but when downloaded through safari is saved as example.csv.html
$data = "1,bob,programmer\n";
$data .= "2,steve,manager\n";
$data .= "3,jim,ceo\n";
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename=export.csv');
header("Pragma: no-cache");
header("Expires: 0");
echo $data;
exit();
How can I prevent safari from adding on the html extension?
Edit: Even with the changes suggested below, I continue to get 'export.csv.html' on download in safari