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

kapil thangavelu k_vertigo@yahoo.com
Tue, 9 Oct 2001 02:54:58 -0700


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