Re: Error Struts 7

Ute Kaiser <[email protected]> Thu, 16 Oct 2025 22:23:35 +0200
Newsgroups gmane.comp.jakarta.struts.user
Message-ID <[email protected]>
Hi Lukasz,
I was curious on the doku change. Hard to find, I found it on the deprecated=
 File Upload page but not the Action File Upload page.=20
Best regards Ute

> Am 09.10.2025 um 16:37 schrieb Lukasz Lenart <[email protected]>:
>=20
> =EF=BB=BFAdded a note about that
> https://github.com/apache/struts-site/pull/276
>=20
> niedz., 5 pa=C5=BA 2025 o 19:45 Lukasz Lenart <[email protected]> na=
pisa=C5=82(a):
>>=20
>> Btw. this is already reported
>> https://issues.apache.org/jira/browse/WW-5474
>> https://issues.apache.org/jira/browse/FILEUPLOAD-351
>>=20
>> niedz., 5 pa=C5=BA 2025 o 19:42 Lukasz Lenart <[email protected]> n=
apisa=C5=82(a):
>>>=20
>>> wt., 30 wrz 2025 o 21:21 Ute Kaiser <[email protected]> napisa=C5=82(=
a):
>>>> I want to add some comments here about the somehow misleading documenta=
tion on this.
>>>>>>=20
>>>> Files Number Limit
>>>>=20
>>>> Since Struts 6.1.2 a new option was added, which uses Commons FileUploa=
d feature to limit how many files can be uploaded at once, in one request. T=
his option requires to use Commons FileUpload ver. 1.5 at least and by defau=
lt is set to 256. Please always set this to a finite value to prevent DoS at=
tacks.
>>>> To change this value define a constant in struts.xml as follows:
>>>> <struts>
>>>>    <constant name=3D"struts.multipart.maxFiles" value=3D"500"/>
>>>> </struts>
>>>> <<
>>>>=20
>>>> Today, I used
>>>> <constant name=3D"struts.multipart.maxFiles" value=3D"3"/>
>>>> because I have 3 file upload tags on my mask.
>>>> But the application crashed, even with only one file upload,  till I fo=
und a debug message in wildfly server.log
>>>>>>=20
>>>> 2025-09-30 15:14:22,443 DEBUG [org.apache.struts2.dispatcher.multipart.=
AbstractMultiPartRequest] (default task-2) Applies max size: xxx to file upl=
oad request
>>>> 2025-09-30 15:14:22,443 DEBUG [org.apache.struts2.dispatcher.multipart.=
AbstractMultiPartRequest] (default task-2) Applies max files number: 3 to fi=
le upload request
>>>> 2025-09-30 15:14:22,443 DEBUG [org.apache.struts2.dispatcher.multipart.=
AbstractMultiPartRequest] (default task-2) Applies max size of single file: x=
xx to file upload request
>>>> 2025-09-30 15:14:22,483 DEBUG [org.apache.struts2.dispatcher.multipart.=
AbstractMultiPartRequest] (default task-2) Error parsing the multi-part requ=
est!: org.apache.commons.fileupload2.core.FileUploadFileCountLimitException:=
 attachment
>>>>    at deployment.resy.ear//org.apache.commons.fileupload2.core.Abstract=
FileUpload.lambda$parseRequest$1(AbstractFileUpload.java:465)
>>>>    at deployment.resy.ear//org.apache.commons.io.function.IOIterator.fo=
rEachRemaining(IOIterator.java:77)
>>>>    at deployment.resy.ear//org.apache.commons.fileupload2.core.Abstract=
FileUpload.parseRequest(AbstractFileUpload.java:462)
>>>>    at deployment.resy.ear//org.apache.commons.fileupload2.jakarta.servl=
et6.JakartaServletFileUpload.parseRequest(JakartaServletFileUpload.java:117)=

>>>>    at deployment.resy.ear//org.apache.struts2.dispatcher.multipart.Jaka=
rtaMultiPartRequest.processUpload(JakartaMultiPartRequest.java:51)
>>>> <<
>>>> Debugging org.apache.commons told me that all my parameters counted, no=
t only the fileupload parameter.
>>>=20
>>> Thanks for pointing this out, I can update the docs only as we base on
>>> what Commons Fileupload provides
>>> https://commons.apache.org/proper/commons-fileupload/commons-fileupload2=
-core/apidocs/org/apache/commons/fileupload2/core/AbstractFileUpload.html#se=
tFileCountMax(long)
>>>=20
>>>=20
>>> Cheers
>>> =C5=81ukasz
>=20
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>=20