
This class is designed to parse a request coming from a multipart encoded form (ie: file upload form)
This does not support the full multipart spec, but support mixed form fields and files (multiple ok).

This class is designed to parse a request coming from a multipart encoded form (ie: file upload form)
This does not support the full multipart spec, but support mixed form fields and files (multiple ok).
After calling request.parseMultiPartContent() you will get the following in the request:
The eventual regular form fields(text) will go automatically in the request so you can use them as ususal with request.getParameter()
If their are files, they will be stored in the request as well, so you can later use request.getFile("name"); and save/process the data.
Example of use:
request.parseMultiPartContent("/tmp", 50000000);
String someField=request.getParameter("htmlField1");
JOTMultiPartItem item=request.getFile("htmlFile1");
File f=new File("/tmp",item.getFileName());
FileOutputStream fos=new FileOutputStream(f);
item.copyDataTo(fos);
fos.flush();
fos.close();