Hi fellow Zopiasts! I'm having a problem with getting the value from a Form field. Here's some code: FORM ACTION=convuplmethod METHOD="POST" ENCTYPE="multipart/form-data"> <TABLE CELLSPACING="2"> <TR> <TH ALIGN="LEFT" VALIGN="TOP"><EM><STRONG>XML File</STRONG></EM></TD> <TD ALIGN="LEFT" VALIGN="TOP"> <INPUT TYPE="file" NAME="filenaamXML:string" SIZE="25"> </TD> </TR> <TR><TH></TH> <TD> <INPUT TYPE="SUBMIT" VALUE="Proceed"> <INPUT TYPE="reset" VALUE="Reset"> </TD> </TR> </FORM> now how do I get the value that is filled in in the field? In my convuplmethod method I have: <dtml-var "REQUEST.form['filenaamXML']"> But this returns the contents of the file, and all I want is the path. Thanks in advance, Bart Holthuijsen. ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
Hi Bart :-) Bart Holthuijsen wrote:
<INPUT TYPE="file" NAME="filenaamXML:string" SIZE="25">
Take this :string off the end for starters. An input type of "FILE" causes a binary file to be uploaded. Zope handles this by turning it into a FileUpload object. Trying to parse it as a string can't be helping matters ;-)
now how do I get the value that is filled in in the field? In my convuplmethod method I have:
<dtml-var "REQUEST.form['filenaamXML']">
But this returns the contents of the file, and all I want is the path.
You will only get the path from certain browsers, IE I think. If you want the file name, it can be displayed with the following: <dtml-var "REQUEST.form['filenaamXML'].filename"> If you need any more help, it might be useful if you explain what you're trying to do overall :-) HTH, Chris
participants (2)
-
Bart Holthuijsen -
Chris Withers