This is an automated email from the ASF dual-hosted git repository. git-site-role pushed a commit to branch asf-staging in repository https://gitbox.apache.org/repos/asf/struts-site.git
The following commit(s) were added to refs/heads/asf-staging by this push: new edb5ee980 Updates stage by Jenkins edb5ee980 is described below commit edb5ee9804b239d7439b13ed8107e3e6646a780d Author: jenkins <bui...@apache.org> AuthorDate: Thu Mar 2 06:48:43 2023 +0000 Updates stage by Jenkins --- content/core-developers/file-upload.html | 35 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/content/core-developers/file-upload.html b/content/core-developers/file-upload.html index bc799f265..e2fc18b3a 100644 --- a/content/core-developers/file-upload.html +++ b/content/core-developers/file-upload.html @@ -150,6 +150,7 @@ </li> <li><a href="#advanced-configuration" id="markdown-toc-advanced-configuration">Advanced Configuration</a> <ul> <li><a href="#file-size-limits" id="markdown-toc-file-size-limits">File Size Limits</a></li> + <li><a href="#files-number-limit" id="markdown-toc-files-number-limit">Files Number Limit</a></li> <li><a href="#file-types" id="markdown-toc-file-types">File Types</a></li> <li><a href="#error-messages" id="markdown-toc-error-messages">Error Messages</a></li> <li><a href="#temporary-directories" id="markdown-toc-temporary-directories">Temporary Directories</a></li> @@ -463,27 +464,24 @@ in necessary to change these values. The names and default values are:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>struts.multipart.parser=jakarta struts.multipart.saveDir= struts.multipart.maxSize=2097152 +struts.multipart.maxFiles=256 </code></pre></div></div> <blockquote> - <p>Please remember that the <code class="language-plaintext highlighter-rouge">struts.multipart.maxSize</code> is the size limit of the whole request, which means when you uploading multiple files, -the sum of their size must be below the <code class="language-plaintext highlighter-rouge">struts.multipart.maxSize</code>!</p> + <p>Please remember that the <code class="language-plaintext highlighter-rouge">struts.multipart.maxSize</code> 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 <code class="language-plaintext highlighter-rouge">struts.multipart.maxSize</code>!</p> </blockquote> -<p>In order to change theses settings you define a constant in your applications <code class="language-plaintext highlighter-rouge">struts.xml</code> file like so:</p> +<p>In order to change these settings you define a constant in your applications <code class="language-plaintext highlighter-rouge">struts.xml</code> file like so:</p> -<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span> -<span class="cp"><!DOCTYPE struts PUBLIC - "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" - "http://struts.apache.org/dtds/struts-2.0.dtd"></span> -<span class="nt"><struts></span> +<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><struts></span> <span class="nt"><constant</span> <span class="na">name=</span><span class="s">"struts.multipart.maxSize"</span> <span class="na">value=</span><span class="s">"1000000"</span><span class="nt">/></span> ... <span class="nt"></struts></span> </code></pre></div></div> -<p>Additionally the <code class="language-plaintext highlighter-rouge">fileUpload</code> interceptor has settings that can be put in place for individual action mappings by -customizing your interceptor stack.</p> +<p>Additionally, the <code class="language-plaintext highlighter-rouge">fileUpload</code> interceptor has settings that can be put in place for individual action mappings +by customizing your interceptor stack.</p> <div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><action</span> <span class="na">name=</span><span class="s">"doUpload"</span> <span class="na">class=</span><span class="s">"com.example.UploadAction"</span><span class="nt">></span> <span class="nt"><interceptor-ref</span> <span class="na">name=</span><span class="s">"basicStack"</span><span class="nt">/></span> @@ -507,11 +505,7 @@ more than one file on a form the <code class="language-plaintext highlighter-rou sizes. The other setting, <code class="language-plaintext highlighter-rouge">maximumSize</code>, is an interceptor setting that is used to ensure a particular Action does not receive a file that is too large. Notice the locations of both settings in the following example:</p> -<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span> -<span class="cp"><!DOCTYPE struts PUBLIC - "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" - "http://struts.apache.org/dtds/struts-2.0.dtd"></span> -<span class="nt"><struts></span> +<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><struts></span> <span class="nt"><constant</span> <span class="na">name=</span><span class="s">"struts.multipart.maxSize"</span> <span class="na">value=</span><span class="s">"1000000"</span><span class="nt">/></span> <span class="nt"><action</span> <span class="na">name=</span><span class="s">"doUpload"</span> <span class="na">class=</span><span class="s">"com.example.UploadAction"</span><span class="nt">></span> @@ -525,7 +519,18 @@ receive a file that is too large. Notice the locations of both settings in the f <span class="nt"><result</span> <span class="na">name=</span><span class="s">"success"</span><span class="nt">></span>good_result.jsp<span class="nt"></result></span> <span class="nt"></action></span> <span class="nt"></struts></span> +</code></pre></div></div> + +<h3 id="files-number-limit">Files Number Limit</h3> +<p>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 version 1.5 at least and by default is set to 256. +To change this value define a constant in <code class="language-plaintext highlighter-rouge">struts.xml</code> as follows:</p> + +<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><struts></span> + <span class="nt"><constant</span> <span class="na">name=</span><span class="s">"struts.multipart.maxFiles"</span> <span class="na">value=</span><span class="s">"500"</span><span class="nt">/></span> + +<span class="nt"></struts></span> </code></pre></div></div> <h3 id="file-types">File Types</h3>