Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16452

Align MultiPart handling in Automation and Batch upload (WebEngine)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2025.x
    • Component/s: Automation, WebEngine
    • Release Notes Description:
      Hide

      Breaking Changes

      The Maven module nuxeo-webengine-ui has been removed.

      The org.nuxeo.ecm.webengine.forms.FormData support within WebEngine has been removed in favor of the Jersey mechanism.

      The following classes have been removed from Nuxeo:

      • org.nuxeo.ecm.automation.jaxrs.io.InputStreamDataSource
      • org.nuxeo.ecm.automation.jaxrs.io.SharedFileInputStream
      • org.nuxeo.ecm.automation.jaxrs.io.documents.MultipartBlobs
      • org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter
      • org.nuxeo.ecm.automation.jaxrs.io.operations.MultiPartFormRequestReader reworked and renamed to org.nuxeo.ecm.automation.io.rest.operations.MultiPartExecutionRequestReader
      • org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper.BoundaryMediaType
      • org.nuxeo.ecm.webengine.forms.FormData

      The following fields have been removed from Nuxeo:

      • org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#MULTIPART_FILENAME_UTF_8

      The following methods have been removed from Nuxeo:

      • org.nuxeo.ecm.webengine.model.WebContext#getForm()

      The following methods don't throw javax.mail.MessagingException anymore:

      • org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#blobs(List)
      • org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#blobs(List, int)
      • org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#getResponse(Object, HttpServletRequest)
      • org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#getResponse(Object, HttpServletRequest, int)

      The following nuxeo.conf property has been removed as it is now the default and only option: nuxeo.multipart.filename.utf8.encoding

      Show
      Breaking Changes The Maven module nuxeo-webengine-ui has been removed. The org.nuxeo.ecm.webengine.forms.FormData support within WebEngine has been removed in favor of the Jersey mechanism. The following classes have been removed from Nuxeo: org.nuxeo.ecm.automation.jaxrs.io.InputStreamDataSource org.nuxeo.ecm.automation.jaxrs.io.SharedFileInputStream org.nuxeo.ecm.automation.jaxrs.io.documents.MultipartBlobs org.nuxeo.ecm.automation.jaxrs.io.documents.BlobsWriter org.nuxeo.ecm.automation.jaxrs.io.operations.MultiPartFormRequestReader reworked and renamed to org.nuxeo.ecm.automation.io.rest.operations.MultiPartExecutionRequestReader org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper.BoundaryMediaType org.nuxeo.ecm.webengine.forms.FormData The following fields have been removed from Nuxeo: org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#MULTIPART_FILENAME_UTF_8 The following methods have been removed from Nuxeo: org.nuxeo.ecm.webengine.model.WebContext#getForm() The following methods don't throw javax.mail.MessagingException anymore: org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#blobs(List) org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#blobs(List, int) org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#getResponse(Object, HttpServletRequest) org.nuxeo.ecm.automation.server.jaxrs.ResponseHelper#getResponse(Object, HttpServletRequest, int) The following nuxeo.conf property has been removed as it is now the default and only option: nuxeo.multipart.filename.utf8.encoding
    • Tags:
    • Team:
      PLATFORM
    • Sprint:
      nxplatform #114, nxplatform #115
    • Story Points:
      2

      Description

      We parse MultiPart request in 2 different ways:

      • In Automation, it uses MultiPartRequestReader and MultiPartFormRequestReader classes, which use javax.mail.*.
      • In Batch Upload (and WebEngine), it uses FormData, which use Apache Commons Fileupload.

      We have an issue on the filename, when it contains other characters than the one in US-ASCII.

      Commons Fileupload reads correctly encoded filename in the header, as it uses UTF-8 encoding by default.

      However, javax.mail seems to fail at it, it cannot decode correctly the filename. To make it correctly decode the filename, we should use filename*=UTF-8'' in the part header:

      ...
      form-data; name="file"; filename*=UTF-8''blablaéèôûü__.txt
      ...
      

      Browsers (at least Chrome and Firefox) send only filename in the part header:

      ...
      form-data; name="file"; filename="blablaéèôûü__.txt"
      ...
      

      => We should probably align all the code to use Apache Commons Fileupload to parse MultiPart requests, and make sure we send correctly encoded part headers.

      We also generate MultiPart response with javax.mail.*, since NXP-32651 we have a configuration property to switch the generation mechanism to Jersey.

      => We should remove all MultiPart generation using javax.mail.* and make the Jersey mechanism the default and only one.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: