| java.lang.Object de.danet.an.util.multipartform.HttpMultiPartParser
HttpMultiPartParser | public class HttpMultiPartParser (Code) | | This class provides methods for parsing a HTML multi-part form. Each
method returns a Hashtable which contains keys for all parameters sent
from the web browser. The corresponding values are either type "String"
or "FileInfo" depending on the type of data in the corresponding part.
The following is a sample InputStream expected by the methods in this
class:
-----------------------------7ce23a18680
Content-Disposition: form-data; name="SomeTextField1"
on
-----------------------------7ce23a18680
Content-Disposition: form-data; name="LocalFile1"; filename="C:\temp\testit.c"
Content-Type: text/plain
#include <stdlib.h>
int main(int argc, char **argv)
{
printf("Testing\n");
return 0;
}
-----------------------------7ce23a18680--
See Also: de.danet.an.util.multipartform.FileInfo author: Anil Hemrajani |
parseData | public Hashtable parseData(ServletInputStream data, String boundary, String saveInDir) throws IllegalArgumentException, IOException(Code) | | Parses the InputStream, separates the various parts and returns
them as key=value pairs in a Hashtable. Any incoming files are
saved in directory "saveInDir" using the client's file name; the
file information is stored as FileInfo object in the Hashtable
("value" part).
Parameters: data - input stream of the servlet request Parameters: boundary - boundary value from the Content-Type http header Parameters: saveInDir - directory to save as files Hashtable with FileInfo objects throws: IllegalArgumentException - throws: IOException - |
parseData | public Hashtable parseData(ServletInputStream data, String boundary) throws IllegalArgumentException, IOException(Code) | | Parses the InputStream, separates the various parts and returns
them as key=value pairs in a Hashtable. Any incoming files are
saved as byte arrays; the file information is stored as java.io.File
object in the Hashtable ("value" part).
Parameters: data - input stream of the servlet request Parameters: boundary - boundary value from the Content-Type http header Hashtable with FileInfo objects throws: IllegalArgumentException - throws: IOException - |
|
|