MWS has a global max upload size that is managed in the Content Service Admin portlet. By default, this is set to 20MB. Feel free to change this as you need.
If you want to have more fine grained control on a portlet application by portlet application basis, you can add the following JSF validator to your portlet app. However, no multipart Http POST will get to your code if it is larger than the global max upload file size.
This code sample limits the uploaded file to be 4MB
/**
* Validator to check file size
*/
public void customFile_validator(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value) {
if (value instanceof FileItem) {
FileItem fileItem = (FileItem)value;
long maxSize = 4 * 1024000; //4 MB
if (maxSize < fileItem.getSize()) {
//file is too big, so throw a validator exception
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
"File must be smaller than 4 MB",
"File must be smaller than 4 MB"));
}
}
}
#webMethods#webMethods-BPMS#MWS-CAF-Task-Engine