[Zope] MimeWriter and encode64 with zope file objs

Dieter Maurer dieter@handshake.de
Thu, 5 Jun 2003 22:20:56 +0200


drew nichols wrote at 2003-6-5 09:40 +1000:
 > ...
 >                 base64.encode (file, body)
 > 
 > This works fine with no encoding and text data, but binary data needs 
 > encoding.
 > encode64 will not encode as the zope file has no read() method.
 > Should i write my own wrapper class, or is there a simpler way??

If your files are not too large, you can use "encode_string"
and convert the "file" into a string with "str(file.data)".


Dieter