EntityImages entImage = (EntityImages)mainModule.getById(id);
if (imageData!=null && fileName!=null) {
- int fileType = -1;
- if (contentType.equals("image/jpeg")) fileType=0;
- if (contentType.equals("image/gif")) fileType=1;
- if (fileType>=0)
+ String fileType = "-1";
+ if (contentType.equals("image/jpeg")) fileType="0";
+ if (contentType.equals("image/gif")) fileType="1";
+ if (fileType != "-1")
entImage.setImage(imageData, fileType);
else
theLog.printError("Wrong file uploaded!");
EntityImages entImage = (EntityImages)mainModule.getById(id);
if (imageData!=null && fileName!=null) {
- int fileType = -1;
- if (contentType.equals("image/jpeg")) fileType=0;
- if (contentType.equals("image/gif")) fileType=1;
- if (fileType>=0)
+ String fileType = "-1";
+ if (contentType.equals("image/jpeg")) fileType="0";
+ if (contentType.equals("image/gif")) fileType="1";
+ if (fileType != "-1")
entImage.setImage(imageData, fileType);
else
theLog.printError("Wrong file uploaded!");
String fileName=mpReq.getFilename();
String contentType=mpReq.getContentType();
- int fileType = -1;
- if (contentType.equals("image/jpeg")) fileType=0;
- if (contentType.equals("image/gif")) fileType=1;
- if (fileType>=0) {
+ String fileType = "-1";
+ if (contentType.equals("image/jpeg")) fileType="0";
+ if (contentType.equals("image/gif")) fileType="1";
+ if (fileType != "-1") {
EntityImages entImage = (EntityImages)mainModule.getById(idParam);
entImage.setImage(imageData, fileType);
}