Posted by Brad on 04/26/06 22:10
I have a file that downloaded a CSV file for the user based upon some
information gathered from the Database. My file was working fine until
recently (I believe that my hosting company did something when they
upgraded to PHP5). Everytime a user tries to download the file, it
displays the contents on the screen. Here is what I have for my file
handling. Am I missing anything obvious?
when called, $filecontent is displayed to the screen...
$downloadfile=$shownic."AttendeeRoster".time().".csv";
header("Content-disposition: attachment; filename=$downloadfile");
header("Content-type: text/css; charset=UTF-8");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".strlen($filecontent));
header("Pragma: no-cache");
header("Expires: 0");
echo $filecontent;
Any help is greatly appreciated.
~Brad
Navigation:
[Reply to this message]
|