0

I am using Tomcat 10 ( Jakarta EE implementation ) in my project, and using CommonFileUpload jar with implementation "FileUploadBase.isMultipartContent(request);". isMultipartContent expect request argument of type javax not jakarta. And in commonFileUpload jar only javax package is imported like "import javax.servlet.http.HttpServletRequest". One method I found to use MultipartConfig but how to implement this method in my project.

m_isRequestContainFiles = FileUploadBase.isMultipartContent(request);

    if (m_isRequestContainFiles){
        I have upload = new DiskFileUpload();
        try {
            m_fieldsWhenFormContainsFiles = **upload.parseRequest(request);**

Can anyone help me how to implement multipartconfig method here with import jakarta.servlet.* import org.apache.commons.fileupload.*;

I want to use only Jakarta servlet in my project as I am using Tomcat 10.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
sid
  • 1
  • 1
  • Commons file upload is not necessary anymore since December 2009. That's almost 14 years ago! Please timely catch up the current state of technology. See abovelinked duplicate how to utilize native servlet API instead. – BalusC May 12 '23 at 13:34

0 Answers0