public class MultiPartFilter extends Object implements javax.servlet.Filter
This class decodes the multipart/form-data stream sent by a HTML form that uses a file input item. Any files sent are stored to a temporary file and a File object added to the request as an attribute. All other values are made available via the normal getParameter API and the setCharacterEncoding mechanism is respected when converting bytes to Strings.
If the init parameter "delete" is set to "true", any files created will be deleted when the current request returns.
The init parameter maxFormKeys sets the maximum number of keys that may be present in a form (default set by system property org.eclipse.jetty.server.Request.maxFormKeys or 1000) to protect against DOS attacks by bad hash keys.
The init parameter deleteFiles controls if uploaded files are automatically deleted after the request completes. Use init parameter "maxFileSize" to set the max size file that can be uploaded. Use init parameter "maxRequestSize" to limit the size of the multipart request.
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE_SUFFIX |
Constructor and Description |
---|
MultiPartFilter() |
public static final String CONTENT_TYPE_SUFFIX
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
Filter.init(javax.servlet.FilterConfig)
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
Filter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain)
public void destroy()
destroy
in interface javax.servlet.Filter
Filter.destroy()
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.