| javax.servlet.http.HttpServletRequestWrapper org.wings.session.MultipartRequest
MultipartRequest | final public class MultipartRequest extends HttpServletRequestWrapper (Code) | | A utility class to handle multipart/form-data requests,
the kind of requests that support file uploads. This class can
receive arbitrarily large files (up to an artificial limit you can set),
and fairly efficiently too. And it knows and works around several browser
bugs that don't know how to upload files correctly.
A client can upload files using an HTML form with the following structure.
Note that not all browsers support file uploads.
<FORM ACTION="/servlet/Handler" METHOD=POST
ENCTYPE="multipart/form-data">
What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
Which file to upload? <INPUT TYPE=FILE NAME=file> <BR>
<INPUT TYPE=SUBMIT>
</FORM>
The full file upload specification is contained in experimental RFC 1867,
available at
http://ds.internic.net/rfc/rfc1867.txt.
author: Holger Engels |
Inner Class :class UploadedFile | |
MultipartRequest | public MultipartRequest(HttpServletRequest request) throws IOException(Code) | | Parameters: request - the servlet request throws: IOException - if the uploaded content is larger than 1 Megabyteor there's a problem reading or parsing the request |
MultipartRequest | public MultipartRequest(HttpServletRequest request, int maxPostSize) throws IOException(Code) | | Parameters: request - the servlet request Parameters: maxPostSize - the maximum size of the POST content throws: IOException - if the uploaded content is larger thanmaxPostSize or there's a problem reading or parsing the request |
getContentType | public String getContentType(String name)(Code) | | Returns the content type of the specified file (as supplied by the
client browser), or null if the file was not included in the upload.
Parameters: name - the file name the content type of the file |
getFile | public File getFile(String name)(Code) | | Returns a File object for the specified file saved on the server's
filesystem, or null if the file was not included in the upload.
Parameters: name - the file name a File object for the named file |
getFileId | public String getFileId(String name)(Code) | | Returns the fileid of the specified file, or null if the
file was not included in the upload. The fileid is the name
under which the file is saved in the filesystem.
Parameters: name - the file name the filesystem name of the file |
getFileName | public String getFileName(String name)(Code) | | Returns the filename of the specified file, or null if the
file was not included in the upload. The filename is the name
specified by the user. It is not the name under which the file is
actually saved.
Parameters: name - the file name the filesystem name of the file |
getFileNames | public Iterator getFileNames()(Code) | | Returns the names of all the uploaded files as an Enumeration of
Strings. It returns an empty Enumeration if there are no uploaded
files. Each file name is the name specified by the form, not by
the user.
the names of all the uploaded files as an Enumeration of Strings |
getParameterMap | public Map getParameterMap()(Code) | | |
getParameterNames | public Enumeration getParameterNames()(Code) | | Returns the names of all the parameters as an Enumeration of
Strings. It returns an empty Enumeration if there are no parameters.
the names of all the parameters as an Enumeration of Strings |
isMultipart | final public boolean isMultipart()(Code) | | Indicates if this class was successfully able to parse request as multipart request.
|
putParameter | protected void putParameter(String name, String value)(Code) | | Stores a parameter identified in this request.
|
setException | protected void setException(String param, Exception ex)(Code) | | Store exception as request parameter.
|
|
|