Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

Re: [PHP3] csv file download problems... From: Richard Lynch (richard <email protected>)
Date: 05/15/00

In article <eo2rhskfg13buvipld7b7i6cv1otjimp1v <email protected>>,
owlcat <email protected> (Jamie Pratt) wrote:

> Hi .. I have a script that writes out a csv file to disk from data in
> a mysql db that I then create a link to on the web page, so that the
> user can download it... It correctly saves/downloads/opens from the
> browser and everything, but when trying to load it in MS-excel, it
> gets an error loading the file .. upon inspection, the file is coming
> down with only LF's in it... (not CR-LF's like in the windows/dos
> world).. I know I could do it with ftp and get it to work correctly,
> but perhaps I am missing something in httpd.conf or something?
> (mime-types? I did mess with these as well as AddType in httpd.conf
> but had no success...!) =20

If you want your files to be DOS files, you'll need to use something like:

fwrite("...\r\n");

or

fputs("...\r");

to get the \r in there for DOS.

-- 
Richard Lynch                | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA        | http://www.L-I-E.com/artists.htm
http://www.zend.com          | (this has nothing to do with Zend, duh!)

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>