tribby
05-06-2001, 03:35 PM
Hi,
I wrote a small PHP script for downloading text files from my site.
To accomplish this, I've used the following headers:
header( "Content-type: text/plain" );
header( "Content-Disposition: attachment; filename=$filename" );
header( "Content-Description: PHP Generated Data" );
Setting the Content-Disposition to 'attachment' forces a download, which is what I want. However, this apprently forces the file to download as a binary file... Since it's downloading a text file I need it to transfer as an ascii file instead... Otherwise, instead of the file having line breaks, the whole file is on one line with a single character representing each line break. Anyone know a work-around or another way to accomplish this?
Thanks,
Tribby
I wrote a small PHP script for downloading text files from my site.
To accomplish this, I've used the following headers:
header( "Content-type: text/plain" );
header( "Content-Disposition: attachment; filename=$filename" );
header( "Content-Description: PHP Generated Data" );
Setting the Content-Disposition to 'attachment' forces a download, which is what I want. However, this apprently forces the file to download as a binary file... Since it's downloading a text file I need it to transfer as an ascii file instead... Otherwise, instead of the file having line breaks, the whole file is on one line with a single character representing each line break. Anyone know a work-around or another way to accomplish this?
Thanks,
Tribby