Extract zip file from email attachment

Basilisk96 basilisk96 at gmail.com
Sat Apr 7 01:04:30 EDT 2007


>
> Could the file like object still be encoded in MIME or something?
>

Yes it is. You don't need to seek(0).
Try this:

decoded = email.base64mime.decode(part.get_payload())
fileObj.write(decoded)


-Basilisk96




More information about the Python-list mailing list