Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java =================================================================== diff -u -rf85bba9a5bc622498557dff4b14c5f7281f7043b -r6764496fb69cd36d5dfc21a71c8fd149d597bdfc --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java (.../NbAuthoringForm.java) (revision f85bba9a5bc622498557dff4b14c5f7281f7043b) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java (.../NbAuthoringForm.java) (revision 6764496fb69cd36d5dfc21a71c8fd149d597bdfc) @@ -265,26 +265,14 @@ (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); float maxFileSize = UploadFileUtil.getMaxFileSize(); - - - /* if (toolContentId == null) - { - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(NoticeboardConstants.ERROR_MANDATORY, "Tool COntent id")); - } - if (title==null || title.length()==0) - { - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(NoticeboardConstants.ERROR_MANDATORY, "Title")); - } */ - - //check the file sizes so of the file uploads + if (this.offlineFile != null && offlineFile.getFileSize()!= 0) { float sizeOfOfflineUpload = offlineFile.getFileSize() / 1024 / 1024; //check the file size if (sizeOfOfflineUpload > maxFileSize) { - //show message saying the file is greater than the allowed limit - logger.error("the file uploaded exceeds the maximum file size"); + logger.error("file size " + sizeOfOfflineUpload + " Max File Size allowed: " + maxFileSize); errors.add("filesize", new ActionMessage("error.exceedMaxFileSize")); this.setMethod("Instructions"); } @@ -296,8 +284,8 @@ if (sizeOfOnlineUpload > maxFileSize) { -// show message saying the file is greater than the allowed limit - logger.error("the file uploaded exceeds the maximum file size"); + + logger.error("file size " + sizeOfOnlineUpload + " Max File Size allowed: " + maxFileSize); errors.add("filesize", new ActionMessage("error.exceedMaxFileSize")); this.setMethod("Instructions"); } @@ -307,6 +295,10 @@ } + private boolean isEmpty(String str) { + return str == null || str.trim().length() == 0 ; + } + }