diskFileUpload.setSizeMax(DEFAULT_SIZE_MAX);
List list = diskFileUpload.parseRequest(req);
for (int i = 0; i < list.size(); i++) {
LiferayFileItem fileItem = (LiferayFileItem)list.get(i);
if (fileItem.isFormField()) {
fileItem.setString(req.getCharacterEncoding());
}
LiferayFileItem[] fileItems =
(LiferayFileItem[])_params.get(fileItem.getFieldName());
if (fileItems == null) {
fileItems = new LiferayFileItem[] {fileItem};
}
else {
LiferayFileItem[] newFileItems =
new LiferayFileItem[fileItems.length + 1];
System.arraycopy(
fileItems, 0, newFileItems, 0, fileItems.length);
newFileItems[newFileItems.length - 1] = fileItem;
fileItems = newFileItems;
}
_params.put(fileItem.getFieldName(), fileItems);
if(fileItem.getFileName() != null)
_params.put(fileItem.getFileName(), new LiferayFileItem[] {fileItem});
}
}
catch (FileUploadException fue) {
Logger.error(this,fue.getMessage(),fue);