We had the same issue when going to Tomcat 11.

You need to make two changes.
1) get the request params passed in via.........   jakarta.servlet.http.Part

Like so.........

import jakarta.servlet.http.Part;

Part fileUpload = request.getPart("param-name");

               if(null != fileUpload) {
                    fileUpload.write(targetFile.getAbsolutePath());

2)define the multi-part values in the servlet def in the web.xml...........



                    <servlet>
                           <servlet-name>uploadfile</servlet-name>
                           
<jsp-file>/record/process/captureandconfirm.vpp</jsp-file>
                           <multipart-config>
                               <location>/web/tmp</location>
                               <max-file-size>20848820</max-file-size>
                               <max-request-size>418018841</max-request-size>
                               
<file-size-threshold>1048576</file-size-threshold>
                           </multipart-config>
                       </servlet>
                       <servlet-mapping>
                           <servlet-name>uploadfile</servlet-name>
                           
<url-pattern>/record/process/captureandconfirm.vpp</url-pattern>
</servlet-mapping>






Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-----Original Message-----
From: Ernesto Reinaldo Barreiro <reier...@gmail.com>
Sent: Thursday, May 1, 2025 8:51 PM
To: users@tomcat.apache.org
Subject: [EXT]multipart and Apache Tomcat 11

[You don't often get email from reier...@gmail.com. Learn why this is important 
at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

We have an Apache Wicket application that I just ported to wicket 10. The 
application works as expected with the latest Tomcat 10.1.40. But our 
application does not work with Tomcat 11.0.6 because file upload (multipart 
processing is broken).

Apache wicket 10.x uses fileupload2.jakarta.servlet5 thus I create a branch 
using fileupload2.jakarta.servlet6 (
https://mvnrepository.com/artifact/org.apache.commons/commons-fileupload2-jakarta-servlet6/2.0.0-M2)
thinking that might be the problem... But after some debugging the problem 
seems to be in Http11InputBuffer and related classes (it seems the whole 
package is very different from 10.x branch) or the way fileupload2 is using 
them.

Has anyone experienced any similar problems?

--
Regards - Ernesto Reinaldo Barreiro
CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.

PLEASE NOTE: This message may contain confidential information and is intended 
only for the individual(s) named. Employees of Cumulus Media Inc. and its 
subsidiaries (including Westwood One) are prohibited from disclosing 
confidential information to any third party. If you are not the named addressee 
you should not disseminate, distribute or copy this e-mail. Please notify the 
sender immediately by e-mail if you have received this e-mail by mistake and 
delete this e-mail from your system. If you are not the intended recipient you 
are notified that disclosing, copying, distributing or taking any action in 
reliance on the contents of this information is strictly prohibited.

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

Reply via email to