upload file via web form (Re: to Trent Mick's posting)

Aki Niimura akineko at pacbell.net
Mon Jul 7 20:14:59 EDT 2003


akineko at pacbell.net (Aki Niimura) wrote in message 
> I found the 'body' doesn't have CRLF ('\n\r') which some servers may
> consider it as a line terminator (for MIME headers).
> 
> After I inserted the following line:
> body = string.replace(body, '\n', '\r\n')
> It is working correctly.

The above is not correct. The body may have '\r\n' already (such as from
Windows). Applying string.replace() to such document produces '\r\n\n'.
You need to limit the conversion to the MIME header portion or you can fix
the code where MIME header is generated.

Sorry for messing up.

Best regards,
Aki Niimura




More information about the Python-list mailing list