i think you cant access the fileitem via the
parameter parser. but i remember something like
foo.getFileItem();
take a look at the API. its somewhere hidden in there...
/heiko
-----Ursprüngliche Nachricht-----
Von: Matthew Inger [mailto:matti@sedonacorp.com]
Gesendet: Mittwoch, 3. April 2002 17:10
An: Turbine Users List
Betreff: RE: upload a file from a form
You need to parse the data different. Servlet API does
not parse multipart/form-data. I would reccommend o'reilly's
org.oreilly.servlet package. go to www.oreilly.org for more
information. It's a java package written by Jason Hunter
(who also wrote the O'Reilly Java Servlet book). You MUST
buy the book to legally use the classes.
-----Original Message-----
From: plecozler@mailhub7.isdnet.net
[mailto:plecozler@mailhub7.isdnet.net]On Behalf Of Patrice Le Cozler
Sent: Wednesday, April 03, 2002 9:34 AM
To: turbine-user@jakarta.apache.org
Subject: upload a file from a form
Hello,
I need to upload a XML file from a form and parse it to put the datas it
contains in a database.
So I wrote my form like this :
| <form method="post" ENCTYPE="multipart/form-data"
action="$link.setPage("Index.vm").setAction("SQL")">
| upload :
| <input type=file name="upfile">
| <input type="submit" name="eventSubmit_doUpload"
value="Upload">
| </form>
...and the corresponding SQL.java like that :
| public void doUpload(RunData data, Context context)
| throws Exception
| {
| Log.debug("Upload : "+data.getParameters().getString("upfile"));
| }
( the Log.debug method just allows me to verify that the doUpload method
is called when I press the "Upload" button of the form )
but all I get in my log file is :
Upload :
so where's the file name ?
thanks
Patrice
--
To unsubscribe, e-mail:
<mailto:turbine-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:turbine-user-help@jakarta.apache.org>
--
To unsubscribe, e-mail: <mailto:turbine-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-user-help@jakarta.apache.org>
|