On Tuesday 09 October 2001 07:30 am, Vineet.Ahuja@de.abb.com wrote:
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!
test.py:- def testext(self): f = open ("vin.doc","rb") dataread=f.read() fname='myvineet123' self.manage_addProduct['ExtDocument'].manage_addExtDocument(id=fname, title='t2', file=dataread) f.close() return dataread
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 string
try passing in the actual file object not the string read from the file kapil