Log in

View Full Version : PHP ...preserving line breaks carriage returns in header downloads



tedteeter
07-05-2015, 01:23 AM
Greetings, July 4th 2015

I am attempting to utilize the header function while correctly formatting the header fields such as Content-Type etc! Oddly when I use force download irregardless of file read method I cannot preserve line breaks, carriage returns in files that retain such?...The download works fine!...Any ideas would be greatly appreciated!

Ted

Beverleyh
07-05-2015, 06:51 AM
Please post a copy of the php script and download file that demonstrates the problem.

Beverleyh
07-05-2015, 07:21 AM
Thinking about it, maybe the problem is with the file upload process rather than download - if something is getting corrupted or converted on the way to the server? Or a different interpretation of carriage returns between a Windows computer and a Unix server? (Assuming that's what you're using) This may shed some light http://stackoverflow.com/a/9866809 Try uploading the file that is to be downloaded in binary then ASCII mode to see if that makes a difference.

tedteeter
07-05-2015, 10:20 PM
Thanks for the response!...very much appreciated!...I did run across this problem several years ago..and was just reminded that notepad didn't read the line breaks appropriately, however, if opened in wordpad things look great!...and as usual I can't recall the solution I came up with...Again, I very much appreciate your response :-)
Ted