Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6244

ContentDisposition should support UTF-8 filenames

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0.4, 3.1
    • Component/s: Core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      I have a need to support uploading files via a JAXRS web service interface with CXF. The file payload is modeled as an Attachment and everything works fine when the filenames are plain ASCII or ISO-8859-1. If the filename is passed as UTF-8 chars, then the name is mangled on the server.

      RFC 5987 describes an encoding scheme to support UTF-8 characters in HTTP Headers. It would be nice if the Attachment / Content-Disposition from CXF supported this. The workaround without this is to access the Content-Disposition header directly and parse the name yourself.

      Something along the lines of:

      Content-Disposition = "attachment; filename*=UTF-8''%c2%a3%20and%20%e2%82%ac%20rates

      Note that the filename param is actually named "filename*". Perhaps the ContentDisposition class should check for these variants first and fallback to the non-extended versions?

      If accepted as an issue, I could provide a test case and patch.

        Attachments

          Activity

            People

            • Assignee:
              sergey_beryozkin Sergey Beryozkin
              Reporter:
              massfords Mark Ford
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: