Dear All,

Firstly, I am a newbie to php so please be gentle.

I'm having problems with carriage returns placed in a file on a Linux based
server. When this file is download to a WindowsXP machine the carriage
returns are quite frankly useless. I just get "[]" (where "[]" represents an
undisplayable character. No actual carriage returns or newlines!

I generate the file using the following code (fragment only):

      fputs($file_op,"$f_title, $f_first_name, $f_surname, $f_email\n");

I then use the following link to a download_it.php script as described in
Tansley as follows:

 echo "<A HREF=\"downloadit.php?$parameters\">download it</A>";

The download_it.php file looks as follows:
header("Content-type: Application/octet-stream");
header("Content-Disposition: attachment;filename=download/download.txt");
header("Content-Description: PHP Download");
header("Content-Length: $file_size");

Appart from the fact that the Content-Disposition appears not to be working
under IE6 since the file name is not correct.

The downloaded file does not contain Windows type carriage returns of
newlines! However it does contains the data thank goodness.

What is the fix?

Henry Grech-Cini

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to