Eric Fernandez wrote at 2006-8-10 12:52 +0100:
> ...
>from OFS.Image import File
>def PUT_factory( self, name, typ, body ):
>    if typ.startswith('text'):
>        ob = File(name, '', body, content_type=typ)
>    return ob
>However, I cannot upload jpg files anymore... What am I doing wrong there?

... because you create an object only when "typ" is of the "text*"
variety. Otherwise, you will get an exception because you use
an object not yet assigned to ("ob").

Have a look at the standard PUT_factory. It is
Copy it its body to your function and modify it as appropriate.

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to