You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by jianhlang <ji...@qq.com.INVALID> on 2025/09/24 03:02:34 UTC

File upload and download issue in Tomcat 9.0.106

Dear users,


My application(jsf2.2+primeface6.0,OEPNJDK1.8) running well when deployed in Tomcat9.0.105,but without any code changes and it facing a file upload and file download issue by using Tomcat9(&gt;= 9.0.106).


code as below:
<p:fileUpload id="fileUploadId" fileUploadListener="#{invInfoAM.uploadFile}" fileLimit="1"
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mode="advanced" sizeLimit="20971520" allowTypes="/(\.|\/)(jpe?g|png|pdf)$/"
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oncomplete="recognition();"/&gt;

apache common lib we used:



Do we have any suggestion to solve this issue?

Re: File upload and download issue in Tomcat 9.0.106

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jianh,

On 9/26/25 1:29 AM, jianhlang wrote:
> Thank you for your reply,its helpful to me.

Were you able to resolve your issue?

-chris

> 发件人:Christopher Schultz <chris@christopherschultz.net&gt;
> 发件时间:2025年9月24日 20:16
> 收件人:users <users@tomcat.apache.org&gt;
> 主题:Re: File upload and download issue in Tomcat 9.0.106
> 
> 
> 
>         Jianh,
> 
> On&nbsp;9/24/25&nbsp;4:58&nbsp;AM,&nbsp;jianhlang&nbsp;wrote:
> &gt;&nbsp;When&nbsp;i&nbsp;use&nbsp;Tomcat&nbsp;9.0.105(no&nbsp;configures&nbsp;changed)&nbsp;to&nbsp;deploy&nbsp;my&nbsp;app&nbsp;and&nbsp;upload&nbsp;a&nbsp;pdf&nbsp;file&nbsp;on&nbsp;a&nbsp;function,everything&nbsp;goes&nbsp;well,and&nbsp;pdf&nbsp;file&nbsp;uploaded.
> &gt;&nbsp;But&nbsp;when&nbsp;change&nbsp;to&nbsp;Tomcat&nbsp;9.0.106(no&nbsp;configures&nbsp;changed)&nbsp;to&nbsp;deploy&nbsp;the&nbsp;same&nbsp;app,&nbsp;then&nbsp;upload&nbsp;the&nbsp;same&nbsp;file,the&nbsp;page&nbsp;auto&nbsp;refreshed&nbsp;and&nbsp;file&nbsp;stream&nbsp;is&nbsp;null.
> &gt;&nbsp;The&nbsp;network&nbsp;in&nbsp;firefox&nbsp;showed&nbsp;'Request&nbsp;has&nbsp;been&nbsp;truncated'
> &gt;&nbsp;
> &gt;&nbsp;
> &gt;&nbsp;env&nbsp;as&nbsp;below
> &gt;&nbsp;both&nbsp;win11&nbsp;and&nbsp;linux&nbsp;facing&nbsp;this&nbsp;issue.
> &gt;&nbsp;java-1.8.0-openjdk-1.8.0.345
> &gt;&nbsp;<dependency&amp;gt;
> &gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<groupId&amp;gt;commons-fileupload</groupId&amp;gt;
> &gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<artifactId&amp;gt;commons-fileupload</artifactId&amp;gt;
> &gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<version&amp;gt;1.5</version&amp;gt;
> &gt;&nbsp;</dependency&amp;gt;
> &gt;&nbsp;
> &gt;&nbsp;<dependency&amp;gt;
> &gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<groupId&amp;gt;commons-io</groupId&amp;gt;
> &gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<artifactId&amp;gt;commons-io</artifactId&amp;gt;
> &gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<version&amp;gt;2.5</version&amp;gt;
> &gt;&nbsp;</dependency&amp;gt;
> 
> Here&nbsp;is&nbsp;the&nbsp;changelog&nbsp;for&nbsp;9.0.106:
> 
> https://tomcat.apache.org/tomcat-9.0-doc/changelog.html#Tomcat_9.0.106_(remm)
> 
> I&nbsp;think&nbsp;this&nbsp;change&nbsp;might&nbsp;be&nbsp;relevant:
> 
> "
> Provide&nbsp;finer&nbsp;grained&nbsp;control&nbsp;of&nbsp;multi-part&nbsp;request&nbsp;processing&nbsp;via&nbsp;two&nbsp;
> new&nbsp;attributes&nbsp;on&nbsp;the&nbsp;Connector&nbsp;element.&nbsp;maxPartCount&nbsp;limits&nbsp;the&nbsp;total&nbsp;
> number&nbsp;of&nbsp;parts&nbsp;in&nbsp;a&nbsp;multi-part&nbsp;request&nbsp;and&nbsp;maxPartHeaderSize&nbsp;limits&nbsp;the&nbsp;
> size&nbsp;of&nbsp;the&nbsp;headers&nbsp;provided&nbsp;with&nbsp;each&nbsp;part.&nbsp;Add&nbsp;support&nbsp;for&nbsp;these&nbsp;new&nbsp;
> attributes&nbsp;to&nbsp;the&nbsp;ParameterLimitValve.
> "
> 
> I&nbsp;recommend&nbsp;that&nbsp;you&nbsp;review&nbsp;these&nbsp;new&nbsp;settings:
> 
> https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Common_Attributes
> 
> Specifically:
> 
> "
> maxPartCount&nbsp;-&nbsp;The&nbsp;maximum&nbsp;total&nbsp;number&nbsp;of&nbsp;parts&nbsp;permitted&nbsp;in&nbsp;a&nbsp;request&nbsp;
> where&nbsp;the&nbsp;content&nbsp;type&nbsp;is&nbsp;multipart/form-data.&nbsp;This&nbsp;limit&nbsp;is&nbsp;in&nbsp;addition&nbsp;
> to&nbsp;maxParameterCount.&nbsp;A&nbsp;value&nbsp;of&nbsp;less&nbsp;than&nbsp;0&nbsp;means&nbsp;no&nbsp;limit.&nbsp;If&nbsp;not&nbsp;
> specified,&nbsp;a&nbsp;default&nbsp;of&nbsp;50&nbsp;is&nbsp;used.&nbsp;Requests&nbsp;that&nbsp;exceed&nbsp;this&nbsp;limit&nbsp;may&nbsp;
> be&nbsp;ignored&nbsp;depending&nbsp;on&nbsp;how&nbsp;the&nbsp;application&nbsp;processes&nbsp;the&nbsp;request.&nbsp;The&nbsp;
> FailedRequestFilter&nbsp;filter&nbsp;can&nbsp;be&nbsp;used&nbsp;to&nbsp;always&nbsp;reject&nbsp;requests&nbsp;that&nbsp;
> exceed&nbsp;the&nbsp;limit.
> "
> 
> Note&nbsp;that&nbsp;the&nbsp;default&nbsp;limit&nbsp;is&nbsp;50.&nbsp;If&nbsp;you&nbsp;have&nbsp;mroe&nbsp;than&nbsp;50&nbsp;"parts"&nbsp;in&nbsp;
> your&nbsp;<form&gt;&nbsp;(this&nbsp;includes&nbsp;ALL&nbsp;<input&gt;,&nbsp;etc.&nbsp;in&nbsp;the&nbsp;<form&gt;)&nbsp;then&nbsp;you&nbsp;
> might&nbsp;need&nbsp;to&nbsp;raise&nbsp;this&nbsp;limit.
> 
> "
> maxPartHeaderSize&nbsp;-&nbsp;The&nbsp;maximum&nbsp;number&nbsp;of&nbsp;header&nbsp;bytes&nbsp;permitted&nbsp;per&nbsp;
> part&nbsp;in&nbsp;a&nbsp;request&nbsp;where&nbsp;the&nbsp;content&nbsp;type&nbsp;is&nbsp;multipart/form-data.&nbsp;
> Requests&nbsp;that&nbsp;exceed&nbsp;this&nbsp;limit&nbsp;will&nbsp;be&nbsp;rejected.&nbsp;A&nbsp;value&nbsp;of&nbsp;less&nbsp;than&nbsp;0&nbsp;
> means&nbsp;no&nbsp;limit.&nbsp;If&nbsp;not&nbsp;specified,&nbsp;a&nbsp;default&nbsp;of&nbsp;512&nbsp;is&nbsp;used.
> "
> 
> You&nbsp;might&nbsp;want&nbsp;to&nbsp;check&nbsp;your&nbsp;Network&nbsp;tab&nbsp;in&nbsp;your&nbsp;browser&nbsp;to&nbsp;see&nbsp;if&nbsp;there&nbsp;
> are&nbsp;any&nbsp;Parts&nbsp;which&nbsp;have&nbsp;large&nbsp;headers.&nbsp;This&nbsp;can&nbsp;happen&nbsp;if&nbsp;the&nbsp;filename&nbsp;
> is&nbsp;unusually&nbsp;large.&nbsp;If&nbsp;you&nbsp;think&nbsp;you&nbsp;need&nbsp;more&nbsp;than&nbsp;512&nbsp;bytes&nbsp;per&nbsp;part,&nbsp;
> then&nbsp;you&nbsp;might&nbsp;want&nbsp;to&nbsp;raise&nbsp;this&nbsp;limit.
> 
> -chris
> 
> 
> ---------------------------------------------------------------------
> To&nbsp;unsubscribe,&nbsp;e-mail:&nbsp;users-unsubscribe@tomcat.apache.org
> For&nbsp;additional&nbsp;commands,&nbsp;e-mail:&nbsp;users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: File upload and download issue in Tomcat 9.0.106

Posted by jianhlang <ji...@qq.com.INVALID>.
Chris,


Thank you for your reply,its helpful to me.




         原始邮件
         
       
发件人:Christopher Schultz <chris@christopherschultz.net&gt;
发件时间:2025年9月24日 20:16
收件人:users <users@tomcat.apache.org&gt;
主题:Re: File upload and download issue in Tomcat 9.0.106



       Jianh,

On&nbsp;9/24/25&nbsp;4:58&nbsp;AM,&nbsp;jianhlang&nbsp;wrote:
&gt;&nbsp;When&nbsp;i&nbsp;use&nbsp;Tomcat&nbsp;9.0.105(no&nbsp;configures&nbsp;changed)&nbsp;to&nbsp;deploy&nbsp;my&nbsp;app&nbsp;and&nbsp;upload&nbsp;a&nbsp;pdf&nbsp;file&nbsp;on&nbsp;a&nbsp;function,everything&nbsp;goes&nbsp;well,and&nbsp;pdf&nbsp;file&nbsp;uploaded.
&gt;&nbsp;But&nbsp;when&nbsp;change&nbsp;to&nbsp;Tomcat&nbsp;9.0.106(no&nbsp;configures&nbsp;changed)&nbsp;to&nbsp;deploy&nbsp;the&nbsp;same&nbsp;app,&nbsp;then&nbsp;upload&nbsp;the&nbsp;same&nbsp;file,the&nbsp;page&nbsp;auto&nbsp;refreshed&nbsp;and&nbsp;file&nbsp;stream&nbsp;is&nbsp;null.
&gt;&nbsp;The&nbsp;network&nbsp;in&nbsp;firefox&nbsp;showed&nbsp;'Request&nbsp;has&nbsp;been&nbsp;truncated'
&gt;&nbsp;
&gt;&nbsp;
&gt;&nbsp;env&nbsp;as&nbsp;below
&gt;&nbsp;both&nbsp;win11&nbsp;and&nbsp;linux&nbsp;facing&nbsp;this&nbsp;issue.
&gt;&nbsp;java-1.8.0-openjdk-1.8.0.345
&gt;&nbsp;<dependency&amp;gt;
&gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<groupId&amp;gt;commons-fileupload</groupId&amp;gt;
&gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<artifactId&amp;gt;commons-fileupload</artifactId&amp;gt;
&gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<version&amp;gt;1.5</version&amp;gt;
&gt;&nbsp;</dependency&amp;gt;
&gt;&nbsp;
&gt;&nbsp;<dependency&amp;gt;
&gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<groupId&amp;gt;commons-io</groupId&amp;gt;
&gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<artifactId&amp;gt;commons-io</artifactId&amp;gt;
&gt;&nbsp;&nbsp;&nbsp;&amp;nbsp;&nbsp;&amp;nbsp;<version&amp;gt;2.5</version&amp;gt;
&gt;&nbsp;</dependency&amp;gt;

Here&nbsp;is&nbsp;the&nbsp;changelog&nbsp;for&nbsp;9.0.106:

https://tomcat.apache.org/tomcat-9.0-doc/changelog.html#Tomcat_9.0.106_(remm)

I&nbsp;think&nbsp;this&nbsp;change&nbsp;might&nbsp;be&nbsp;relevant:

"
Provide&nbsp;finer&nbsp;grained&nbsp;control&nbsp;of&nbsp;multi-part&nbsp;request&nbsp;processing&nbsp;via&nbsp;two&nbsp;
new&nbsp;attributes&nbsp;on&nbsp;the&nbsp;Connector&nbsp;element.&nbsp;maxPartCount&nbsp;limits&nbsp;the&nbsp;total&nbsp;
number&nbsp;of&nbsp;parts&nbsp;in&nbsp;a&nbsp;multi-part&nbsp;request&nbsp;and&nbsp;maxPartHeaderSize&nbsp;limits&nbsp;the&nbsp;
size&nbsp;of&nbsp;the&nbsp;headers&nbsp;provided&nbsp;with&nbsp;each&nbsp;part.&nbsp;Add&nbsp;support&nbsp;for&nbsp;these&nbsp;new&nbsp;
attributes&nbsp;to&nbsp;the&nbsp;ParameterLimitValve.
"

I&nbsp;recommend&nbsp;that&nbsp;you&nbsp;review&nbsp;these&nbsp;new&nbsp;settings:

https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Common_Attributes

Specifically:

"
maxPartCount&nbsp;-&nbsp;The&nbsp;maximum&nbsp;total&nbsp;number&nbsp;of&nbsp;parts&nbsp;permitted&nbsp;in&nbsp;a&nbsp;request&nbsp;
where&nbsp;the&nbsp;content&nbsp;type&nbsp;is&nbsp;multipart/form-data.&nbsp;This&nbsp;limit&nbsp;is&nbsp;in&nbsp;addition&nbsp;
to&nbsp;maxParameterCount.&nbsp;A&nbsp;value&nbsp;of&nbsp;less&nbsp;than&nbsp;0&nbsp;means&nbsp;no&nbsp;limit.&nbsp;If&nbsp;not&nbsp;
specified,&nbsp;a&nbsp;default&nbsp;of&nbsp;50&nbsp;is&nbsp;used.&nbsp;Requests&nbsp;that&nbsp;exceed&nbsp;this&nbsp;limit&nbsp;may&nbsp;
be&nbsp;ignored&nbsp;depending&nbsp;on&nbsp;how&nbsp;the&nbsp;application&nbsp;processes&nbsp;the&nbsp;request.&nbsp;The&nbsp;
FailedRequestFilter&nbsp;filter&nbsp;can&nbsp;be&nbsp;used&nbsp;to&nbsp;always&nbsp;reject&nbsp;requests&nbsp;that&nbsp;
exceed&nbsp;the&nbsp;limit.
"

Note&nbsp;that&nbsp;the&nbsp;default&nbsp;limit&nbsp;is&nbsp;50.&nbsp;If&nbsp;you&nbsp;have&nbsp;mroe&nbsp;than&nbsp;50&nbsp;"parts"&nbsp;in&nbsp;
your&nbsp;<form&gt;&nbsp;(this&nbsp;includes&nbsp;ALL&nbsp;<input&gt;,&nbsp;etc.&nbsp;in&nbsp;the&nbsp;<form&gt;)&nbsp;then&nbsp;you&nbsp;
might&nbsp;need&nbsp;to&nbsp;raise&nbsp;this&nbsp;limit.

"
maxPartHeaderSize&nbsp;-&nbsp;The&nbsp;maximum&nbsp;number&nbsp;of&nbsp;header&nbsp;bytes&nbsp;permitted&nbsp;per&nbsp;
part&nbsp;in&nbsp;a&nbsp;request&nbsp;where&nbsp;the&nbsp;content&nbsp;type&nbsp;is&nbsp;multipart/form-data.&nbsp;
Requests&nbsp;that&nbsp;exceed&nbsp;this&nbsp;limit&nbsp;will&nbsp;be&nbsp;rejected.&nbsp;A&nbsp;value&nbsp;of&nbsp;less&nbsp;than&nbsp;0&nbsp;
means&nbsp;no&nbsp;limit.&nbsp;If&nbsp;not&nbsp;specified,&nbsp;a&nbsp;default&nbsp;of&nbsp;512&nbsp;is&nbsp;used.
"

You&nbsp;might&nbsp;want&nbsp;to&nbsp;check&nbsp;your&nbsp;Network&nbsp;tab&nbsp;in&nbsp;your&nbsp;browser&nbsp;to&nbsp;see&nbsp;if&nbsp;there&nbsp;
are&nbsp;any&nbsp;Parts&nbsp;which&nbsp;have&nbsp;large&nbsp;headers.&nbsp;This&nbsp;can&nbsp;happen&nbsp;if&nbsp;the&nbsp;filename&nbsp;
is&nbsp;unusually&nbsp;large.&nbsp;If&nbsp;you&nbsp;think&nbsp;you&nbsp;need&nbsp;more&nbsp;than&nbsp;512&nbsp;bytes&nbsp;per&nbsp;part,&nbsp;
then&nbsp;you&nbsp;might&nbsp;want&nbsp;to&nbsp;raise&nbsp;this&nbsp;limit.

-chris


---------------------------------------------------------------------
To&nbsp;unsubscribe,&nbsp;e-mail:&nbsp;users-unsubscribe@tomcat.apache.org
For&nbsp;additional&nbsp;commands,&nbsp;e-mail:&nbsp;users-help@tomcat.apache.org

Re: File upload and download issue in Tomcat 9.0.106

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jianh,

On 9/24/25 4:58 AM, jianhlang wrote:
> When i use Tomcat 9.0.105(no configures changed) to deploy my app and upload a pdf file on a function,everything goes well,and pdf file uploaded.
> But when change to Tomcat 9.0.106(no configures changed) to deploy the same app, then upload the same file,the page auto refreshed and file stream is null.
> The network in firefox showed 'Request has been truncated'
> 
> 
> env as below
> both win11 and linux facing this issue.
> java-1.8.0-openjdk-1.8.0.345
> <dependency&gt;
>   &nbsp; &nbsp;<groupId&gt;commons-fileupload</groupId&gt;
>   &nbsp; &nbsp;<artifactId&gt;commons-fileupload</artifactId&gt;
>   &nbsp; &nbsp;<version&gt;1.5</version&gt;
> </dependency&gt;
> 
> <dependency&gt;
>   &nbsp; &nbsp;<groupId&gt;commons-io</groupId&gt;
>   &nbsp; &nbsp;<artifactId&gt;commons-io</artifactId&gt;
>   &nbsp; &nbsp;<version&gt;2.5</version&gt;
> </dependency&gt;

Here is the changelog for 9.0.106:

https://tomcat.apache.org/tomcat-9.0-doc/changelog.html#Tomcat_9.0.106_(remm)

I think this change might be relevant:

"
Provide finer grained control of multi-part request processing via two 
new attributes on the Connector element. maxPartCount limits the total 
number of parts in a multi-part request and maxPartHeaderSize limits the 
size of the headers provided with each part. Add support for these new 
attributes to the ParameterLimitValve.
"

I recommend that you review these new settings:

https://tomcat.apache.org/tomcat-9.0-doc/config/http.html#Common_Attributes

Specifically:

"
maxPartCount - The maximum total number of parts permitted in a request 
where the content type is multipart/form-data. This limit is in addition 
to maxParameterCount. A value of less than 0 means no limit. If not 
specified, a default of 50 is used. Requests that exceed this limit may 
be ignored depending on how the application processes the request. The 
FailedRequestFilter filter can be used to always reject requests that 
exceed the limit.
"

Note that the default limit is 50. If you have mroe than 50 "parts" in 
your <form> (this includes ALL <input>, etc. in the <form>) then you 
might need to raise this limit.

"
maxPartHeaderSize - The maximum number of header bytes permitted per 
part in a request where the content type is multipart/form-data. 
Requests that exceed this limit will be rejected. A value of less than 0 
means no limit. If not specified, a default of 512 is used.
"

You might want to check your Network tab in your browser to see if there 
are any Parts which have large headers. This can happen if the filename 
is unusually large. If you think you need more than 512 bytes per part, 
then you might want to raise this limit.

-chris


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: File upload and download issue in Tomcat 9.0.106

Posted by jianhlang <ji...@qq.com.INVALID>.
When i use Tomcat 9.0.105(no configures changed) to deploy my app and upload a pdf file on a function,everything goes well,and pdf file uploaded.
But when change to Tomcat 9.0.106(no configures changed) to deploy the same app, then upload the same file,the page auto refreshed and file stream is null.
The network in firefox showed 'Request has been truncated'


env as below
both win11 and linux facing this issue.
java-1.8.0-openjdk-1.8.0.345
<dependency&gt;
 &nbsp; &nbsp;<groupId&gt;commons-fileupload</groupId&gt;
 &nbsp; &nbsp;<artifactId&gt;commons-fileupload</artifactId&gt;
 &nbsp; &nbsp;<version&gt;1.5</version&gt;
</dependency&gt;

<dependency&gt;
 &nbsp; &nbsp;<groupId&gt;commons-io</groupId&gt;
 &nbsp; &nbsp;<artifactId&gt;commons-io</artifactId&gt;
 &nbsp; &nbsp;<version&gt;2.5</version&gt;
</dependency&gt;










         原始邮件
         
       
发件人:Chuck Caldarale <n828cl@gmail.com&gt;
发件时间:2025年9月24日 12:00
收件人:Tomcat Users List <users@tomcat.apache.org&gt;
主题:Re: File upload and download issue in Tomcat 9.0.106




&gt;&nbsp;On&nbsp;2025&nbsp;Sep&nbsp;23,&nbsp;at&nbsp;22:02,&nbsp;jianhlang&nbsp;<jianhlang@qq.com.INVALID&gt;&nbsp;wrote:
&gt;&nbsp;
&gt;&nbsp;My&nbsp;application(jsf2.2+primeface6.0,OEPNJDK1.8)&nbsp;running&nbsp;well&nbsp;when&nbsp;deployed&nbsp;in&nbsp;Tomcat9.0.105,but&nbsp;without&nbsp;any&nbsp;code&nbsp;changes&nbsp;and&nbsp;it&nbsp;facing&nbsp;a&nbsp;file&nbsp;upload&nbsp;and&nbsp;file&nbsp;download&nbsp;issue&nbsp;by&nbsp;using&nbsp;Tomcat9(&gt;=&nbsp;9.0.106).
&gt;&nbsp;
&gt;&nbsp;code&nbsp;as&nbsp;below:
&gt;&nbsp;<p:fileUpload&nbsp;id="fileUploadId"&nbsp;fileUploadListener="#{invInfoAM.uploadFile}"&nbsp;fileLimit="1"
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode="advanced"&nbsp;sizeLimit="20971520"&nbsp;allowTypes="/(\.|\/)(jpe?g|png|pdf)$/"
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oncomplete="recognition();"/&gt;
&gt;&nbsp;apache&nbsp;common&nbsp;lib&nbsp;we&nbsp;used:
&gt;&nbsp;
&gt;&nbsp;
&gt;&nbsp;Do&nbsp;we&nbsp;have&nbsp;any&nbsp;suggestion&nbsp;to&nbsp;solve&nbsp;this&nbsp;issue?



What&nbsp;issue?&nbsp;You&nbsp;haven’t&nbsp;told&nbsp;us&nbsp;anything&nbsp;other&nbsp;than&nbsp;the&nbsp;Tomcat&nbsp;version.

For&nbsp;starters,&nbsp;describe&nbsp;the&nbsp;actual&nbsp;problem&nbsp;you’re&nbsp;seeing,&nbsp;the&nbsp;platform&nbsp;you’re&nbsp;running&nbsp;on,&nbsp;and&nbsp;the&nbsp;exact&nbsp;JVM&nbsp;version&nbsp;you’re&nbsp;using.

Note&nbsp;that&nbsp;attachments&nbsp;are&nbsp;stripped&nbsp;in&nbsp;this&nbsp;mailing&nbsp;list,&nbsp;so&nbsp;post&nbsp;only&nbsp;text.

&nbsp;&nbsp;-&nbsp;Chuck

Re: File upload and download issue in Tomcat 9.0.106

Posted by Chuck Caldarale <n8...@gmail.com>.
> On 2025 Sep 23, at 22:02, jianhlang <ji...@qq.com.INVALID> wrote:
> 
> My application(jsf2.2+primeface6.0,OEPNJDK1.8) running well when deployed in Tomcat9.0.105,but without any code changes and it facing a file upload and file download issue by using Tomcat9(>= 9.0.106).
> 
> code as below:
> <p:fileUpload id="fileUploadId" fileUploadListener="#{invInfoAM.uploadFile}" fileLimit="1"
>               mode="advanced" sizeLimit="20971520" allowTypes="/(\.|\/)(jpe?g|png|pdf)$/"
>               oncomplete="recognition();"/>
> apache common lib we used:
> 
> 
> Do we have any suggestion to solve this issue?



What issue? You haven’t told us anything other than the Tomcat version.

For starters, describe the actual problem you’re seeing, the platform you’re running on, and the exact JVM version you’re using.

Note that attachments are stripped in this mailing list, so post only text.

  - Chuck