Message-ID: <2030804633.2713.1429405710349.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2712_1045177578.1429405710349" ------=_Part_2712_1045177578.1429405710349 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
In Jetty5, MultiPartRequest was used for file uploading. In Jetty6, Mult= iPartRequest was changed to MultiPartFilter.=20
MultiPartFilter decodes the multipart/form-data stream sent by a HTML fo=
rm that uses a file input item. A File object is then created and stored to=
the request as an attribute. The attribute name is equal to the name of th=
e file input item of the form being submitted. Therefore if you have a file=
input item with a name of "userfile1", the attribute name for th=
e File object is "userfile1".
Here is a quick tutorial for uploading files.
First, create the page with a form of enctype equal to multipart/form-da=
ta. File uploading won't work if you have a different enctype. Inside the f=
orm element, add an input file item.
Cre= ate a web.xml with filter and servlet mapping for /fileupload url because t= hat's the action we specified in our form.
Cre= ate a FileUpload servlet.
The FileUpload servlet above simply stores the File being uploaded=
to the project target directory.
Simply modify the FileUpload servlet to your desired result. Simply bear= in mind that the attribute name that you should get, should be the same as= the file input item of the form.