Index: lams_tool_laqa/conf/language/ApplicationResources.properties =================================================================== diff -u -r93fb74c295c4cd0ab37e259f0b9176e7f490fdfd -rcd71920aa725c01e396c4ad9b7bd7ef7bd236da2 --- lams_tool_laqa/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 93fb74c295c4cd0ab37e259f0b9176e7f490fdfd) +++ lams_tool_laqa/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision cd71920aa725c01e396c4ad9b7bd7ef7bd236da2) @@ -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 =================================================================== diff -u -reb1b09f9be47e1b73c657af090683e414fd47655 -rcd71920aa725c01e396c4ad9b7bd7ef7bd236da2 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision eb1b09f9be47e1b73c657af090683e414fd47655) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision cd71920aa725c01e396c4ad9b7bd7ef7bd236da2) @@ -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 =================================================================== diff -u -r6c0aa7b6470a5a6195c64d363a386783c0fa3329 -rcd71920aa725c01e396c4ad9b7bd7ef7bd236da2 --- lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 6c0aa7b6470a5a6195c64d363a386783c0fa3329) +++ lams_tool_vote/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision cd71920aa725c01e396c4ad9b7bd7ef7bd236da2) @@ -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 =================================================================== diff -u -ra1f83079a0fedc3d6982fde779286d0246847339 -rcd71920aa725c01e396c4ad9b7bd7ef7bd236da2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision a1f83079a0fedc3d6982fde779286d0246847339) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision cd71920aa725c01e396c4ad9b7bd7ef7bd236da2) @@ -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 */