in reply to Problem with newlines in text file generated for download
The cause of your problem is that, by using the application/* content-type, you are effectively telling the browser that the data is binary and local newline translation should not be done.
Both suaveant's and trantor's suggests will probably work (at least, in the sort-term) but trantor's is (most likely) the better choice, as it will be more portable and will work if anyone ever downloads your text file onto Mac or *nix boxen. On the other hand, Internet Explorer likes to do some evil stuff and ignore Content-* headers at times, so changing the Content-Type to text/plain might cause IE to display the file instead of downloading it. You'll have to test it out to be sure.
bbfu
Seasons don't fear The Reaper.
Nor do the wind, the sun, and the rain.
We can be like they are.
|
|---|