File attachment in multipart form.
Hi, I have created a form which will allow user to attach a file with the submission. I would like to know how should I code so that the server will be able to read the attachment instead of just the location of the file. The following is the code that I use to generate my file attachment. <input type="file" name="attached_file"> I am pretty new to Zope, any help will be very much appreciated ;) -Charlene
Hi Charlene, The form tag should look something like; <form action="foo" enctype="multipart/form-data"> ... your input tags ... </form> In the future, please post questions like this to the general Zope maillist (zope@zope.org), as this maillist is for discussion of the development of the Zope core software (as opposed to use of the same). Thanks! - C "CHOY,CHARLENE (HP-Boise,ex1)" wrote:
Hi, I have created a form which will allow user to attach a file with the submission. I would like to know how should I code so that the server will be able to read the attachment instead of just the location of the file. The following is the code that I use to generate my file attachment.
<input type="file" name="attached_file">
I am pretty new to Zope, any help will be very much appreciated ;)
-Charlene
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
file = REQUEST.form.get('attached_file') file.read() # read the file file.filename # name of original file Andreas ----- Original Message ----- From: "CHOY,CHARLENE (HP-Boise,ex1)" <charlene_choy@hp.com> To: <zope-dev@zope.org> Sent: Montag, 23. Juli 2001 18:10 Subject: [Zope-dev] File attachment in multipart form.
Hi, I have created a form which will allow user to attach a file with the submission. I would like to know how should I code so that the server will be able to read the attachment instead of just the location of the file. The following is the code that I use to generate my file attachment.
<input type="file" name="attached_file">
Hi, dont forget to set ENCTYPE="multipart/form-data" on the form tag. Regards Tino --On Montag, 23. Juli 2001 19:27 -0500 Andreas Jung <andreas@andreas-jung.com> wrote:
file = REQUEST.form.get('attached_file') file.read() # read the file file.filename # name of original file
Andreas
----- Original Message ----- From: "CHOY,CHARLENE (HP-Boise,ex1)" <charlene_choy@hp.com> To: <zope-dev@zope.org> Sent: Montag, 23. Juli 2001 18:10 Subject: [Zope-dev] File attachment in multipart form.
Hi, I have created a form which will allow user to attach a file with the submission. I would like to know how should I code so that the server will be able to read the attachment instead of just the location of the file. The following is the code that I use to generate my file attachment.
<input type="file" name="attached_file">
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
participants (4)
-
Andreas Jung -
CHOY,CHARLENE (HP-Boise,ex1) -
Chris McDonough -
Tino Wildenhain