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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>