You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2023/03/02 07:12:15 UTC

[struts-site] branch WW-5285-max-files updated (1a2aba89f -> 56d22bf1a)

This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a change to branch WW-5285-max-files
in repository https://gitbox.apache.org/repos/asf/struts-site.git


 discard 1a2aba89f WW-5285 Documents struts.multipart.maxFiles option
     new 56d22bf1a WW-5285 Documents struts.multipart.maxFiles option

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (1a2aba89f)
            \
             N -- N -- N   refs/heads/WW-5285-max-files (56d22bf1a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 source/core-developers/file-upload.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


[struts-site] 01/01: WW-5285 Documents struts.multipart.maxFiles option

Posted by lu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5285-max-files
in repository https://gitbox.apache.org/repos/asf/struts-site.git

commit 56d22bf1ad03a57d9ae835ffb391038026f0fe00
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Thu Mar 2 07:44:16 2023 +0100

    WW-5285 Documents struts.multipart.maxFiles option
---
 source/core-developers/file-upload.md | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/source/core-developers/file-upload.md b/source/core-developers/file-upload.md
index 4e2884684..7aec7f81c 100644
--- a/source/core-developers/file-upload.md
+++ b/source/core-developers/file-upload.md
@@ -282,26 +282,23 @@ in necessary to change these values. The names and default values are:
 struts.multipart.parser=jakarta
 struts.multipart.saveDir=
 struts.multipart.maxSize=2097152
+struts.multipart.maxFiles=256
 ```
 
-> Please remember that the `struts.multipart.maxSize` is the size limit of the whole request, which means when you uploading multiple files,
-> the sum of their size must be below the `struts.multipart.maxSize`!
+> Please remember that the `struts.multipart.maxSize` is the size limit of the whole request, which means when you're 
+> uploading multiple files, the sum of their size must be below the `struts.multipart.maxSize`!
 
-In order to change theses settings you define a constant in your applications `struts.xml` file like so:
+In order to change these settings you define a constant in your applications `struts.xml` file like so:
 
 ```xml
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE struts PUBLIC
-        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
-        "http://struts.apache.org/dtds/struts-2.0.dtd">
 <struts>
     <constant name="struts.multipart.maxSize" value="1000000"/>
     ...
 </struts>
 ```
 
-Additionally the `fileUpload` interceptor has settings that can be put in place for individual action mappings by
-customizing your interceptor stack.
+Additionally, the `fileUpload` interceptor has settings that can be put in place for individual action mappings
+by customizing your interceptor stack.
 
 ```xml
 <action name="doUpload" class="com.example.UploadAction">
@@ -327,10 +324,6 @@ sizes. The other setting, `maximumSize`, is an interceptor setting that is used
 receive a file that is too large. Notice the locations of both settings in the following example:
 
 ```xml
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE struts PUBLIC
-        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
-        "http://struts.apache.org/dtds/struts-2.0.dtd">
 <struts>
     <constant name="struts.multipart.maxSize" value="1000000"/>
 
@@ -345,7 +338,19 @@ receive a file that is too large. Notice the locations of both settings in the f
         <result name="success">good_result.jsp</result>
     </action>
 </struts>
+```
+
+### Files Number Limit
+
+Since Struts 6.2.0 a new option was added, which uses Commons FileUpload feature to limit how many files can be uploaded
+at once, in one request. This option requires to use Commons FileUpload ver. 1.5 at least and by default is set to **256**.
+To change this value define a constant in `struts.xml` as follows:
 
+```xml
+<struts>
+    <constant name="struts.multipart.maxFiles" value="500"/>
+    
+</struts>
 ```
 
 ### File Types