9 Jun
2001
9 Jun
'01
7:56 a.m.
On Sat, 9 Jun 2001, Philippe Jadin wrote:
On a site I want to allow users to add files. I created a simple form that has <input type="file"> on it. This form calls a python script with :
context.manage_addProduct['OFSP'].manage_addFile(file)
This doesn't work : it needs two arguments instead of one. It works when I give an id. What I'd like is to have the id generated based on the given filename.
<untested> id = file.filename # not sure about this filename context.manage_addProduct['OFSP'].manage_addFile(id, file=file.read(), title='XYZ', content_type='text/plain') </untested> Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.