E
edwinek
I've written a script which I use to save attached binary files from
e-mails to disk. The core is simply:
decodedfile = bas64.decodestring(attachment)
fle = open('image.jpg','wb')
fle.write(decodedfile)
fle.close
However, the files written to disk are regularly incomplete, i.e.
jpg's having a grey bar at the bottom, gif's don't even display, pdf's
give errors.
What am I doing wrong here?
Thanks,
Edwin
e-mails to disk. The core is simply:
decodedfile = bas64.decodestring(attachment)
fle = open('image.jpg','wb')
fle.write(decodedfile)
fle.close
However, the files written to disk are regularly incomplete, i.e.
jpg's having a grey bar at the bottom, gif's don't even display, pdf's
give errors.
What am I doing wrong here?
Thanks,
Edwin