Message-ID: <1644541090.1327.1432931730671.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1326_1618600577.1432931730671" ------=_Part_1326_1618600577.1432931730671 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.