The upload filter checks if the incoming request has multipart content.
If it doesn't, the request is passed on as is to the next filter in the chain.
If it does, the filter processes the request for form components. If it finds
input from an Upload component, the file contents are stored for access by the
Upload component's decode method.
For other form components, the input is processed and used to create a
request parameter map. The original incoming request is wrapped, and the
wrapped request is configured to use the created map. This means that
subsequent filters in the chain (and Servlets, and JSPs) see the
input from the other components as request parameters.
For advanced users: the UploadFilter uses the Apache commons FileUpload
package to process the file upload. When it detects input from an Upload
component, a org.apache.commons.fileupload.FileItem is placed
in a request attribute whose name is the ID of the HTML input element
written by the Upload component.
|