Reply to Re: text file displaying on screen

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация