[Zope] add image from ExternalMethod

Chris Withers chrisw@nipltd.com
Mon, 05 Aug 2002 17:02:46 +0100


Ruslan Spivak wrote:
> Hello zope-users,
> 
> 
> How can I add an image from ExternalMethod to zope folder?
> Thanks in advance

from OFS.Image import manage_addImage
def addImage(self):
    manage_addImage(self,
                    id,
                    file)

...where id is the id of your new Image and file is an object that behave like a 
file (can be .read()) and has a 'filename' attribute.

cheers,

Chris