On Wed, 2002-08-21 at 10:44, Bob Showalter wrote:
> > -----Original Message-----
> > From: David Zhuo [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, August 21, 2002 1:12 PM
> > To: Connie Chan
> > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; cgi mailing list
> > Subject: Re: Help!! Retrieving Image File
> > 
> > 
> > where do you get the impression that \n\n is for text file 
> > and \r\n\r\n
> > is for binary data??? did you get that somewhere? \r\n\r\n is OS
> > specific but \n\n is portable. does Win32 and UNIX-ish use the same
> > crlf? your best beat is to use \n\n where Perl will
> > translate(transparently in the background) that into whatever correct
> > crlf your OS uses. if you use \r\n\r\n, you are asking your 
> > code not to
> > be portable.
> 
> \r\n (or better, \015\012; see perldoc perlport) is the proper terminator
> for HTTP response header lines, per RFC 2616. Since the header must be
> separated from the response body by a blank line, "Content-Type:
> image/jpeg\r\n\r\n" is an RFC-compliant header. Most clients will accept \n
> alone, but they are not required to by the spec.

true but you don't have to \015\012 or even \r\n and the reason is
because Perl automatically translate that for you when it sees \n\n, it
knows the OS that you are running on and \n is special in Perl

david



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to