added support for configuration of max size of a single upload and the maximum number...
authormh <mh>
Mon, 8 Apr 2002 23:44:00 +0000 (23:44 +0000)
committermh <mh>
Mon, 8 Apr 2002 23:44:00 +0000 (23:44 +0000)
bundles/admin_de.properties
bundles/admin_en.properties
source/config.properties-dist
source/mir/misc/WebdbMultipartRequest.java
source/mircoders/servlet/ServletModuleOpenIndy.java

index 43b898f..e948ae0 100755 (executable)
@@ -334,7 +334,7 @@ open.posting.meta.author=IMC Kollektiv
 open.posting.meta.keywords=Freie Medien, Gegen&ouml;ffentlichkeit
 open.posting.jump_to_form=Direkt zum Eingabeformular springen
 open.posting.title=Ver&ouml;ffentliche Deinen Beitrag
-open.posting.nr_of_media=Anzahl der Medien
+open.posting.nr_of_media=Anzahl der Medien (max 20)
 open.posting.nr_of_media.info=(wenn Du mehr als eine Datei hochladen willst, bitte hier die Anzahl eintragen und den Knopf drücken, <b>bevor</b> Du weitere Felder ausfüllst.)
 open.posting.nr_of_media.submit=Anzahl festlegen
 open.posting.form.title=Ver&ouml;ffentlichungsformular
index d5eaad1..17c25cd 100755 (executable)
@@ -331,7 +331,7 @@ open.posting.meta.author=IMC Kollektiv
 open.posting.meta.keywords=Freie Medien, Gegen&ouml;ffentlichkeit
 open.posting.jump_to_form=Jump dirctly to the form.
 open.posting.title=Publish your article!
-open.posting.nr_of_media=Number of Media Items
+open.posting.nr_of_media=Number of Media Items (max 20)
 open.posting.nr_of_media.info=(wenn Du mehr als eine Datei hochladen willst, bitte hier die Anzahl eintragen und den Knopf drücken, <b>bevor</b> Du weitere Felder ausfüllst.)
 open.posting.nr_of_media.submit=Anzahl festlegen
 open.posting.form.title=Publishing Form
index a778ea1..733a611 100755 (executable)
@@ -48,7 +48,11 @@ GeneratePDF=yes
 Rsync=no
 Rsync.Script.Path=/var/www/bin/rsync-copy
 
+# the maximum allowed size of an uploaded media file in KB.
+MaxMediaUploadSize=20000
 
+# the maximum number of allowed media items to upload at once.
+ServletModule.OpenIndy.MaxMediaUploadItems=20
 
 #
 #
index cc99913..5b1871f 100755 (executable)
@@ -26,7 +26,8 @@ public class WebdbMultipartRequest
   public WebdbMultipartRequest(HttpServletRequest theReq) throws IOException
   {
     req=theReq;
-    mp = new MultipartParser(req, 1024*20480); // maximum eight megabyte
+    int maxSize = Integer.parseInt(MirConfig.getProp("MaxMediaUploadSize"));
+    mp = new MultipartParser(req, 1024*maxSize);
     requestList = new ArrayList();
     _evaluateRequest();
   }
@@ -121,5 +122,5 @@ public class WebdbMultipartRequest
       }
     } // while */
   }
-  
+
 }
index 6483ef4..c4035bd 100755 (executable)
@@ -147,9 +147,12 @@ public class ServletModuleOpenIndy extends ServletModule
   public void addposting(HttpServletRequest req, HttpServletResponse res)
     throws ServletModuleException {
     SimpleHash mergeData = new SimpleHash();
+    String maxMedia = MirConfig.getProp("ServletModule.OpenIndy.MaxMediaUploadItems");
     String numOfMedia = req.getParameter("medianum");
     if(numOfMedia==null||numOfMedia.equals("")){
       numOfMedia="1";
+    } else if(Integer.parseInt(numOfMedia) > Integer.parseInt(maxMedia)) {
+      numOfMedia = maxMedia;
     }
     
     int mediaNum = Integer.parseInt(numOfMedia);