[Zope] Converting File/Image to ExtFile/ExtImage

Satheesh Babu sbabu@tnc.org
Tue, 9 Oct 2001 15:32:50 -0400


Hello,

We have a Zope system where we have a fairly large number of Image and File
objects uploaded. To conserve space (we tried to educate users, but that
didn't work :-(), we've decided to switch to an ExtFile/ExtImage based
system. All that works fine. However, is there any way to script the
conversion from File -> ExtFile and Image -> ExtImage? Whenever I try to
call manage_addExtFile, it gives an IOError:

''''Python script to File->ExtFile"""
for file in context.objectValues(['File']):
    context.manage_delObjects([file.getId(),], REQUEST=context.REQUEST)

context.manage_addProduct['ExtFile'].manage_addExtFile(file.getId(),file.tit
le, descr='',file.data,file.content_type,REQUEST=None)

Error is like

  File C:\ZOPESITE\Products\ExtFile\ExtFile.py, line 101, in
manage_addExtFile
    (Object: LockableItem)
  File C:\ZOPESITE\Products\ExtFile\ExtFile.py, line 371, in
manage_file_upload
    (Object: CatalogAware)
  File C:\ZOPESITE\Products\ExtFile\ExtFile.py, line 472, in _copy
    (Object: CatalogAware)
IOError: (see above)

I'm on a Zope 2.4.1 system on Windows 98 with ExtFile/Image 1.1.3...

Anyone has any pointers? Many thanks in advance...

V. Satheesh Babu       sbabu_at_tnc_dot_org
http://vsbabu.org
"First they ignore you. Then they laugh at you. Then they fight you. Then
you win." - Gandhi