Today I bumped into a nasty challenge when trying to copy a Zope image from ZODB to the filesystem. The reason why it wasn't easy was that Zope splits the file up into chunks if it's upload size is more than 65Kb (2^16 bytes) which I guess it does for being able to "stream" the file back into the browser when viewing the image instead of sending one large blob.
So, this didn't work:
>>> imgobj.meta_type
Image
>>> open(temp_file_path,'wb').write(imgobj.data)
...if the data is big because sometimes imgobj.data
is a string (the binary data) and sometimes is a ImplicitAcquirerWrapper
that you have to iterate over.