in reply to Uploading Unix text to IIS 5.0 Web Server with LWP?

Yes, you should change the content-type to be text/plain. However, that won't fix your problem; you will (I think) need to convert the newlines. However, note that unix2dos is the equivlent of doing s/\cJ/\cM\cJ/sg in the string in question.

Update: Fixed the first \cM to \cJ.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Replies are listed 'Best First'.
Re: Re: Uploading Unix text to IIS 5.0 Web Server with LWP?
by LameNerd (Hermit) on Jun 12, 2003 at 21:00 UTC
    Thanks for your reply. Hopefully you can help me with one question I have. How can I make my script work with web-servers that reside on different OS's? Is there a way for my client LWP script to determine what OS the web server is running on?

      No good way, no. What you can do is look at the Server: header that the web server sends you, and guess the newline convention from that. However, test if the server auto-converts the newlie convention when you fix your content-type.

      IMHO the best way to fix this is on the server side.

      Also, note the update in the grandparent node to this -- I had a \cM where I wanted a \cJ.


      Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).