Forum Moderators: coopster
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".xls");
This method can be used for many different file types. The basics for a text file would be something like
header("Content-type: application/octetstream");
header("Content-Disposition: filename=$file");