FileManager fmgr = RollerFactory.getRoller().getFileManager();
fwd = mapping.findForward("uploadFiles.page");
ActionMessages messages = new ActionMessages();
ActionErrors errors = new ActionErrors();
UploadFileForm theForm = (UploadFileForm)actionForm;
if (theForm.getUploadedFiles().length > 0) {
ServletContext app = servlet.getServletConfig().getServletContext();
boolean uploadEnabled =
RollerRuntimeConfig.getBooleanProperty("uploads.enabled");
if ( !uploadEnabled ) {
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.upload.disabled", ""));
saveErrors(request, errors);
return fwd;
}
//this line is here for when the input page is upload-utf8.jsp,
//it sets the correct character encoding for the response
String encoding = request.getCharacterEncoding();
if ((encoding != null) && (encoding.equalsIgnoreCase("utf-8"))) {
response.setContentType("text/html; charset=utf-8");
}
//retrieve the file representation
FormFile[] files = theForm.getUploadedFiles();
int fileSize = 0;
try {
for (int i=0; i<files.length; i++) {
if (files[i] == null) continue;