[Zope] File to ExtFile

Tim Hicks tim@sitefusion.co.uk
Wed, 13 Feb 2002 14:21:01 -0000


> i'm trying to transfer binary-data from a zope File object to a
> ExtFile object ... just have problems with Input-Output. any ideas
> how to handle this?

urs,

you aren't very specific with the problems you are having, but I'll have a
guess that you are getting errors when you call manage_addExtFile() and use
an existing zope object (the 'File' object) as your 'file' argument.  I had
this trouble (with ExtImage as it happens), but Gregor pointed me in the
direction of StringIO.  If you pass in a StringIO instance containing your
binary data, all should be sweet.  I think this means you'll either have to
use an External Method, or allow StringIO to be imported into python
scripts.

hth

tim