[Zope] upload without form as ExtDocument...how???

Vineet.Ahuja@de.abb.com Vineet.Ahuja@de.abb.com
Tue, 9 Oct 2001 16:30:53 +0200

Dear all,

I am trying to upload an extDocument which is located on my system without
using the form but only using an external python script.(I am doing it
because I have about 500 msworld files and i want to create a loop in
test.py.(and I dont want to use Form)Please Help me!

def testext(self):
    f = open ("vin.doc","rb")
title='t2', file=dataread)
    return dataread

Above is my external python script.And I am calling the external method in
the script below:-

for object in context.objectValues(['Folder']):
   if object.hasProperty('visible') and object.visible:

Now as I run testpy.py from zope i get the following error message:-
Error Type: TypeError
Error Value: open() argument 1 must be string without null bytes, not

Traceback (innermost last):
  File C:\zopewebs\lib\python\ZPublisher\Publish.py, line 223, in
  File C:\zopewebs\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\zopewebs\lib\python\Zope\__init__.py, line 226, in
    (Object: LockableItem)
  File C:\zopewebs\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\zopewebs\lib\python\ZPublisher\mapply.py, line 160, in mapply
    (Object: testpy)
  File C:\zopewebs\lib\python\ZPublisher\Publish.py, line 112, in
    (Object: testpy)
  File C:\zopewebs\lib\python\Shared\DC\Scripts\Bindings.py, line 324, in
    (Object: testpy)
  File C:\zopewebs\lib\python\Shared\DC\Scripts\Bindings.py, line 354, in
    (Object: testpy)
  File C:\zopewebs\lib\python\Products\PythonScripts\PythonScript.py, line
363, in _exec
    (Object: testpy)
    (Info: ({'script': <PythonScript instance at 019A79D8>, 'context':
<Folder instance at 019D6D00>, 'container': <Folder instance at 019D6D00>,
'traverse_subpath': []}, (), {}, None))
  File Script (Python), line 3, in testpy
    (Object: guarded_getattr)
  File C:\zopewebs\lib\python\Products\ExternalMethod\ExternalMethod.py,
line 274, in __call__
    (Object: testext)
    (Info: ((<Folder instance at 0122A5A8>,), {}, None))
  File C:\zopewebs\Extensions\test.py, line 5, in testext
    (Object: LockableItem)
  File C:\zopewebs\lib\python\Products\ExtDocument\ExtDocument.py, line 41,
in manage_addExtDocument
    (Object: LockableItem)
  File C:\zopewebs\lib\python\Products\ExtFile\ExtFile.py, line 371, in
    (Object: CatalogAware)
  File C:\zopewebs\lib\python\Products\ExtFile\ExtFile.py, line 466, in
    (Object: CatalogAware)
TypeError: (see above)

Can you kindly tell me where i am going wrong??
Best Regards,
Vineet Ahuja