savedir = saveDirectory;
// Parse the incoming multipart, storing files in the dir provided,
// and populate the meta objects which describe what we found
MultipartParser parser = new MultipartParser(request, maxPostSize, true, true, encoding);
// Some people like to fetch query string parameters from
// MultipartRequest, so here we make that possible. Thanks to
// Ben Johnson, ben.johnson@merrillcorp.com, for the idea.
if (request.getQueryString() != null) {
// Let HttpUtils create a name->String[] structure
Hashtable queryParameters =
HttpUtils.parseQueryString(request.getQueryString());
// For our own use, name it a name->Vector structure
Enumeration queryParameterNames = queryParameters.keys();
while (queryParameterNames.hasMoreElements()) {
Object paramName = queryParameterNames.nextElement();
String[] values = (String[])queryParameters.get(paramName);
Vector newValues = new Vector();
for (int i = 0; i < values.length; i++) {
newValues.add(values[i]);
}
parameters.put(paramName, newValues);
}
}
Part part;
while ((part = parser.readNextPart()) != null) {
String name = part.getName();
if (part.isParam()) {
// It's a parameter part, add it to the vector of values
ParamPart paramPart = (ParamPart) part;
String value = paramPart.getStringValue();