forgot to make ServletModuleImages use the setImage String.class hack bullshit..
authormh <mh>
Thu, 27 Sep 2001 17:18:31 +0000 (17:18 +0000)
committermh <mh>
Thu, 27 Sep 2001 17:18:31 +0000 (17:18 +0000)
source/mircoders/entity/EntityImages.java
source/mircoders/servlet/ServletModuleImages.java

index c085a7d..f098b68 100755 (executable)
@@ -70,6 +70,7 @@ public class EntityImages extends AbstractEntity implements Entity
         //hack -mh
         if (imageType.equals("1"))
             type = 1;
+         //end hack
             
                if (uploadData!=null) {
                        Connection con=null;PreparedStatement pstmt=null;
index b79c5dd..ac7d746 100755 (executable)
@@ -85,10 +85,10 @@ public class ServletModuleImages extends mir.servlet.ServletModule
       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!");
@@ -121,10 +121,10 @@ public class ServletModuleImages extends mir.servlet.ServletModule
       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!");
@@ -312,10 +312,10 @@ public class ServletModuleImages extends mir.servlet.ServletModule
         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);
         }