[Zope] Re: manage_edit or manage_upload help

Maik Jablonski maik.jablonski@uni-bielefeld.de
Fri, 04 Apr 2003 10:40:15 +0200


Ravneet Sachar wrote:
> Now I am creating a form to edit the contents of the file. On submitting 
> this form, I want the file data to be updated with what was there in the 
> textarea of the form. Seems simple, and I tried to use manage_edit or 
> manage_upload from my python script.
> I am unsuccessful in doing this and get Attribute Errors.

The form should look like:

     <form action="uploadFile" method="post" enctype="multipart/form-data">
     <input type="file" name="file"> <input type="submit" value=" Upload 
file ">
     </form>

The PythonScript 'uploadFile' which handles the Upload-REQUEST should be 
something like:

    ##parameters=file
    context.manage_upload(file)
    return 
context.REQUEST.RESPONSE.redirect('Where/do/you/want/to/go/today')

That's it...

Cheers, Maik

-- 
Deutsche / German Zope User Group
http://www.dzug.org/