Re: [Zope] Help on mass import of images
Hello Seb,
yes, the data has to be in a string format, but you are passing in the string "TheImage", AFAICT. No, no. I used the string "TheImage" only as a placeholder for the posting, because a base64 encoded image is _very_ long. Of course I used the correct string representation of the image in my method. You can see it in the file "import_pictures_base64_asstring.py" I sent you to your private mail adress.
The code looks like this:
>>>>>>> from OFS.Image import Image
def import_pictures(self): id='testbild' handle=Image(id,'','',content_type='image/gif') self._setObject(id,handle) self._getOb(id).update_data('R0lGODlhDwK6...<verylongbase64stringofmyimage>...VdzuWAAAA7',content_type='image/gif') <<<<<<<<<<< But this didn't work. The image object was created, but the image data was broken. When I tried to send the binary data of the image as string I got something like this: self._getOb(id).update_data('GIF89a^0^0.....<verylongbinarystringofmyimage>....^Ä^@^@',content_type='image/gif') This resulted in a "syntax error" from the interpreter... :-( I thought about using FTP too. But actually I want to use my own image class. And I don't know how to tell Zope to use my image class rather than the built in image class when accepting images through FTP.
hookable put: (I searched for 'hookable put' on the zope.org search - follow the resources link at the top of the page for more ideas about where to search the mailing lists from) http://www.zope.org//Members/michel/Projects/Interfaces/NewObjectPutHandler I will look at this page...
Thank you very much for your answer! Sven -- Sven Rudolph GermanMedicalServices.de GmbH Unter den Eichen 5, 65195 Wiesbaden Tel.: 06 11 / 97 46 25 2
participants (1)
-
Sven Rudolph