[Zope] How to create a file from a form?

Casey Duncan c.duncan@nlada.org
Tue, 16 Oct 2001 11:59:41 -0400


On Tuesday 16 October 2001 03:31 am, paolomatador@libero.it allegedly wrote:
> Hi All, I'm trying to create a DTML Document, or a DTML Method or a
> text file from an input form in a web page.
> I have a form with some input text, some checkboxes and radiobutton
> and a submit.
> On submit I have to create a text file and append some text at the
> end of that file.
> I can use the manage_addDTMLDocument method to create that file, even
> if I would create a text file, and not a DTML Document, but I dont
> know how to append any text at the end of the file or how to edit the
> file.
> Can Anyone Help Me?
> Thanx
>

You would use the manage_edit(data,title) method to change the file. 

To append data use this python code (untested):

data = doc.document_src() + data_to_append
doc.manage_edit(data, doc.title)

hth,
/---------------------------------------------------\
  Casey Duncan, Sr. Web Developer
  National Legal Aid and Defender Association
  c.duncan@nlada.org
\---------------------------------------------------/