HTTP file upload is specified in Request For Comments (RFC) 1867. Struts’ File Upload interceptor supports HTTP file upload by seamlessly incorporating the Jakarta Commons FileUpload library that contains a multipart parser. This chapter discusses file upload in general and how you can do single and multiple file uploads in Struts.
When using an HTML form to upload a file or multiple files, the enctype attribute of the form must be assigned multipart/form-data and the form method must be post. The form should look like this.
<form action="anAction" enctype="multipart/form-data" method="post"> ... </form>
To enable the user to select a file you must have an <input type=“file”> ...