Commons FileUpload
  1. Commons FileUpload
  2. FILEUPLOAD-131

MultipartStream always assumes transfer encoding to be BINARY

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      N/A

      Description

      MultipartStream always assumes transfer encoding to be BINARY and does not handle 'Content-Transfer-Encoding' header at all.

        Activity

        Hide
        Walco van Loon added a comment -

        Also see https://issues.apache.org/struts/browse/STR-1528 for a more extensive explanation.

        Show
        Walco van Loon added a comment - Also see https://issues.apache.org/struts/browse/STR-1528 for a more extensive explanation.
        Hide
        Jochen Wiedmann added a comment -

        It is questionable, whether anyone is ready to add support for transfer encoding to the current framework. In other words, this issue can only be solved if someone takes the job to rewrite the parser to use an external library like Jakarta httpcore.

        Show
        Jochen Wiedmann added a comment - It is questionable, whether anyone is ready to add support for transfer encoding to the current framework. In other words, this issue can only be solved if someone takes the job to rewrite the parser to use an external library like Jakarta httpcore.
        Hide
        Walco van Loon added a comment -

        If I understand correctly MIME is not in scope of httpcore, but I would think commons-mime would be a great idea!

        Show
        Walco van Loon added a comment - If I understand correctly MIME is not in scope of httpcore, but I would think commons-mime would be a great idea!
        Hide
        Oleg Kalnichevski added a comment -

        Folks,

        I doubt HttpCore would be of any use here, as it does not (and is not supposed to) provide any content codecs. You probably may want to take a closer look at Commons Codec, which provides two content transfer codecs mentioned in RFC1521: quoted-printable and base64. Some efforts will have to spent on getting those codecs to work with I/O streams, though.

        Oleg

        Show
        Oleg Kalnichevski added a comment - Folks, I doubt HttpCore would be of any use here, as it does not (and is not supposed to) provide any content codecs. You probably may want to take a closer look at Commons Codec, which provides two content transfer codecs mentioned in RFC1521: quoted-printable and base64. Some efforts will have to spent on getting those codecs to work with I/O streams, though. Oleg
        Show
        Jochen Wiedmann added a comment - Question posted to httpcomponents-dev@jakarta, see http://www.nabble.com/Handling-content-transfer-encoding-encoding-and-multipart-requests-with-httpcomponents-tf3539561.html
        Hide
        Deven Phillips added a comment -

        I was just running into this problem myself today. I checked out the SVN HEAD and see that the header object is now being returned properly, but here's an idea:

        When the code retrieves the InputStream for the FileItem, have it return an appropriate InputStream which is based on the content-transport-encoding. For example, if the encoding is Base64, return a Base64InputStream. That way, the implementing developer can be completely ignorant of the underlying encoding and still get valid data. We could also provide a path to access a raw InputStream for "Power Users".

        Show
        Deven Phillips added a comment - I was just running into this problem myself today. I checked out the SVN HEAD and see that the header object is now being returned properly, but here's an idea: When the code retrieves the InputStream for the FileItem, have it return an appropriate InputStream which is based on the content-transport-encoding. For example, if the encoding is Base64, return a Base64InputStream. That way, the implementing developer can be completely ignorant of the underlying encoding and still get valid data. We could also provide a path to access a raw InputStream for "Power Users".

          People

          • Assignee:
            Unassigned
            Reporter:
            Walco van Loon
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development