Posted by Oli Filth on 04/26/06 22:59
Brad said the following on 26/04/2006 20: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;
>
Are you sure you don't want "text/csv", rather than "text/css"??
--
Oli
[Back to original message]
|