Results 1 to 4 of 4

Thread: PHP ...preserving line breaks carriage returns in header downloads

  1. #1
    Join Date
    Jul 2013
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default PHP ...preserving line breaks carriage returns in header downloads

    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

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Please post a copy of the php script and download file that demonstrates the problem.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    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.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  4. #4
    Join Date
    Jul 2013
    Posts
    41
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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

Similar Threads

  1. Resolved file_put_contents line breaks \n
    By ggalan in forum PHP
    Replies: 1
    Last Post: 09-14-2011, 04:33 PM
  2. Adding Line breaks to a textarea box
    By smithster in forum PHP
    Replies: 2
    Last Post: 02-25-2011, 04:08 AM
  3. echo line breaks within <script>
    By ggalan in forum PHP
    Replies: 1
    Last Post: 01-06-2011, 03:47 AM
  4. Replies: 0
    Last Post: 04-02-2009, 01:09 PM
  5. Resolved line breaks in dhtmltooltip
    By joon in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 01-12-2009, 01:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •