To browse and select a file for upload you need a HTML <input type="file"> field in the form.
As stated in the HTML specification you have to use the POST method and the enctype attribute of the
form has to be set to "multipart/form-data".
<form action="upload" method="post" enctype="multipart/form-data">
<input type="text" name="description" />
<input type="file" name="file" />
<input type="submit" />
After submitting such a form, the binary multipart form data is available in the request body in a different format than when the enctype isn't set.
Before Servlet 3.0, the Servlet API didn't natively support multipart/form-data. It supports only the
default form enctype of application/x-www-form-urlencoded. The request.getParameter() and consorts
would all return null when using multipart form data.