[Zope] Update a file

rlanham@speakeasy.net rlanham@speakeasy.net
Mon, 15 Oct 2001 18:38:55 UT


this might help you. note that I could not get manage_Editobjects to work, so I just delete and recreate when user submits changes.


****************editdoc (the form)****************
<form name=frmEditDoc method=post action=updateDoc>
<input type=hidden name=docid value="<dtml-var docid>">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<textarea cols=90 rows=20 name=doctext>
<!--#var expr="_.getitem(docid)"-->
</textarea>
</form>
**********************************


**********updatedoc (the method) ************************
<dtml-call expr="RESPONSE.setHeader('pragma','no-cache')">
<dtml-call
  expr="manage_delObjects(docid)">
<dtml-call
  expr="manage_addDTMLDocument(
    id=docid, file=doctext, title=docid)">
<dtml-call expr="RESPONSE.redirect('edit_doc?docid=' + docid)">
*************************************************