turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bartek Walter <Bartek.Wal...@man.poznan.pl>
Subject Re: upload a file from a form
Date Wed, 03 Apr 2002 16:23:29 GMT
Patrice Le Cozler wrote:
> 
> 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 :
> 

Fulcrum (and T2.1) comes with its own multipart-form parser.

Use something like (AFAIR):
data.getParameters().getFileItem("upfile").getFileName()

Look also ar o.a.f.services.upload.FileItem interface.

> so where's the file name ?
> 
> thanks
> 
> Patrice

Bartek Walter

--
To unsubscribe, e-mail:   <mailto:turbine-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-user-help@jakarta.apache.org>


Mime
View raw message