if (isCancelled(request)){
return mapping.findForward(BaseConstants.FWD_CANCEL);
}
MemberVO token = getCurrentLoggedInUser(request);
MemberForm memberForm = (MemberForm)form;
if (!memberSecurityCheck(request, token)){
return mapping.findForward(BaseConstants.FWD_LOGIN);
}
// Set Max Size
try{
maxFileSize = Integer.parseInt(getAppProp().getValue("avatar.image.size").trim());
}
catch(Exception e){
maxFileSize = 120000; // 120000 Bytes = 120 KB
}
// Set Max Height
try{
maxHeight = Integer.parseInt(getAppProp().getValue("avatar.image.height").trim());
}
catch(Exception e){
maxHeight = 200; // 200 px
}
// Set Max Width
try{
maxWidth = Integer.parseInt(getAppProp().getValue("avatar.image.width").trim());
}
catch(Exception e){
maxWidth = 200; // 200 px
}
FormFile importFile = memberForm.getAvatarUpload();
overwrite = StringUtil.safeString(memberForm.getAvatarUploadOverwrite());
String importFileName = getCurrentLoggedInUser(request).getMemberUserName() + "." + getFileExtensionForImageReader(importFile.getFileName());
int size = importFile.getFileSize();
//-------------------- VALIDATE THE IMAGE -----------------------------------------
// check width and heigh of image