[Zope] RE: [Help] creating a new Image instance via external method

Cayce Ullman c_ullman@yahoo.com
Fri, 26 Nov 1999 08:49:59 -0800 (PST)


<The problem is that when I try to add the new Image

<   folder.manage_addImage(img.id, img.data, '')

<I get a seek error as if there is something wrong
with

I have been doing something very similar to this,
(I was uploading images that I got from 
urllib calls).  And the key is to make the data
a string, otherwise it assumes that data is
a file handle.  So try this :

folder.manage_addImage(img.id, str(img.data),'')

I think that will work.  Also, you may run into 
some issues with that manage_upload's ability to
guess the content type.  If so, I would store,
the original img's content-type and manually set
the content type of your new image after it is 
created.

Cayce

__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com