Servlets do not support multipart/form-data directly, that is, the request object does not parse the form parameters. However, all the information you need is in the request input stream.
There's a little bit of work involved, but you can figure out what to do by working with this
test servlet:
Now use this servlet as the target of your upload:
<form method="POST" action="the servlet" enctype="multipart/form-data">
...
</form>
Look at the results. You'll note that each field in your form appears in its own section (that's why it's called multipart). The sections are delimited by a boundary
string that is passed in the "boundary" attribute of the content type. Each section has its own HTTP headers, including at least "Content-Disposition", which gives you the field name. After all the headers in a section comes a blank line, followed by the actual data, either the file upload data or the form value.
------------------
Phil Hanna
Author of :
JSP: The Complete Reference Instant Java Servlets