How to use the CSV MIME-type?

You could try to force the browser to open a “Save As…” dialog by doing something like:

header('Content-type: text/csv');
header('Content-disposition: attachment;filename=MyVerySpecial.csv');
echo "cell 1, cell 2";

Which should work across most major browsers.

Leave a Comment