Re: Error Struts 7
Lukasz Lenart <[email protected]> Thu, 9 Oct 2025 16:37:41 +0200
| Newsgroups | gmane.comp.jakarta.struts.user |
|---|---|
| Message-ID | <CAMopvkOtfQDAAU3JUQuEmXcDmaoQyLasTU4-EJ4pnX0AjZtNmA@mail.gmail.com> |
Added a note about that https://github.com/apache/struts-site/pull/276 niedz., 5 pa=C5=BA 2025 o 19:45 Lukasz Lenart <[email protected]> nap= isa=C5=82(a): > > Btw. this is already reported > https://issues.apache.org/jira/browse/WW-5474 > https://issues.apache.org/jira/browse/FILEUPLOAD-351 > > niedz., 5 pa=C5=BA 2025 o 19:42 Lukasz Lenart <[email protected]> n= apisa=C5=82(a): > > > > 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 documen= tation on this. > > > >> > > > Files Number Limit > > > > > > Since Struts 6.1.2 a new option was added, which uses Commons FileUpl= oad 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 d= efault is set to 256. Please always set this to a finite value to prevent D= oS attacks. > > > To change this value define a constant in struts.xml as follows: > > > <struts> > > > <constant name=3D"struts.multipart.maxFiles" value=3D"500"/> > > > </struts> > > > << > > > > > > 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 = found a debug message in wildfly server.log > > > >> > > > 2025-09-30 15:14:22,443 DEBUG [org.apache.struts2.dispatcher.multipar= t.AbstractMultiPartRequest] (default task-2) Applies max size: xxx to file = upload request > > > 2025-09-30 15:14:22,443 DEBUG [org.apache.struts2.dispatcher.multipar= t.AbstractMultiPartRequest] (default task-2) Applies max files number: 3 to= file upload request > > > 2025-09-30 15:14:22,443 DEBUG [org.apache.struts2.dispatcher.multipar= t.AbstractMultiPartRequest] (default task-2) Applies max size of single fil= e: xxx to file upload request > > > 2025-09-30 15:14:22,483 DEBUG [org.apache.struts2.dispatcher.multipar= t.AbstractMultiPartRequest] (default task-2) Error parsing the multi-part r= equest!: org.apache.commons.fileupload2.core.FileUploadFileCountLimitExcept= ion: attachment > > > at deployment.resy.ear//org.apache.commons.fileupload2.core.Abstr= actFileUpload.lambda$parseRequest$1(AbstractFileUpload.java:465) > > > at deployment.resy.ear//org.apache.commons.io.function.IOIterator= .forEachRemaining(IOIterator.java:77) > > > at deployment.resy.ear//org.apache.commons.fileupload2.core.Abstr= actFileUpload.parseRequest(AbstractFileUpload.java:462) > > > at deployment.resy.ear//org.apache.commons.fileupload2.jakarta.se= rvlet6.JakartaServletFileUpload.parseRequest(JakartaServletFileUpload.java:= 117) > > > at deployment.resy.ear//org.apache.struts2.dispatcher.multipart.J= akartaMultiPartRequest.processUpload(JakartaMultiPartRequest.java:51) > > > << > > > Debugging org.apache.commons told me that all my parameters counted, = not only the fileupload parameter. > > > > 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-fileupload= 2-core/apidocs/org/apache/commons/fileupload2/core/AbstractFileUpload.html#= setFileCountMax(long) > > > > > > Cheers > > =C5=81ukasz