Index: lams_tool_laqa/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.51 -r1.52 --- lams_tool_laqa/conf/language/ApplicationResources.properties 17 Nov 2006 19:22:28 -0000 1.51 +++ lams_tool_laqa/conf/language/ApplicationResources.properties 14 Dec 2006 01:53:19 -0000 1.52 @@ -170,3 +170,4 @@ #======= End labels: Exported 161 labels for en AU ===== +errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java,v diff -u -r1.22 -r1.23 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 2 Nov 2006 20:49:10 -0000 1.22 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 14 Dec 2006 01:53:19 -0000 1.23 @@ -61,6 +61,7 @@ import org.lamsfoundation.lams.tool.qa.service.IQaService; import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy; import org.lamsfoundation.lams.tool.qa.util.QaToolContentHandler; +import org.lamsfoundation.lams.util.FileValidatorUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -1883,6 +1884,15 @@ /*no file uploaded*/ return; + + //validate upload file size. + ActionMessages errors = new ActionMessages(); + FileValidatorUtil.validateFileSize(uploadedFile, true, errors ); + if(!errors.isEmpty()){ + this.saveErrors(request, errors); + return; + } + logger.debug("uploadedFile.getFileName(): " + uploadedFile.getFileName()); /* if a file with the same name already exists then move the old one to deleted */ Index: lams_tool_vote/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.68 -r1.69 --- lams_tool_vote/conf/language/ApplicationResources.properties 16 Nov 2006 10:50:26 -0000 1.68 +++ lams_tool_vote/conf/language/ApplicationResources.properties 14 Dec 2006 01:52:49 -0000 1.69 @@ -149,3 +149,4 @@ #======= End labels: Exported 142 labels for en AU ===== +errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java,v diff -u -r1.35 -r1.36 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 8 Nov 2006 22:07:03 -0000 1.35 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 14 Dec 2006 01:52:49 -0000 1.36 @@ -59,6 +59,7 @@ import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.tool.vote.util.VoteToolContentHandler; +import org.lamsfoundation.lams.util.FileValidatorUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -2506,6 +2507,14 @@ /*no file uploaded*/ return; + //validate upload file size. + ActionMessages errors = new ActionMessages(); + FileValidatorUtil.validateFileSize(uploadedFile, true, errors ); + if(!errors.isEmpty()){ + this.saveErrors(request, errors); + return; + } + logger.debug("uploadedFile.getFileName(): " + uploadedFile.getFileName()); /* if a file with the same name already exists then move the old one to deleted */