Uploaded image for project: 'Commons FileUpload'
  1. Commons FileUpload
  2. FILEUPLOAD-206

Encoding of parts incorrectly determined and assumed to be

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.2
    • None
    • None

    Description

      When submitting user input form fields with a form having enctype="multipart/form-data", FileUpload assumes "ISO-8...-1" to be the default encoding for each part, not taking into account that request.getContentEncoding() returns "UTF-8".

      The description of FILEUPLOAD-101 states: "Each individual part in the 'multipart/form-data' encoded requests may have its own content type definition."

      In my opinion, this assumption is wrong, as the the multipart/form-data encoding algorithm tells the right opposite regarding non file form fields:

      "... The parts of the generated multipart/form-data resource that correspond to non-file fields must not have a Content-Type header specified. Their names and values must be encoded using the character encoding selected above (field names in particular do not get converted to a 7-bit safe encoding as suggested in RFC 2388)..."

      See: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#multipart-form-data

      So for now as user of FileUpload, i don't see a way to tell FileUpload that my FormFields are UTF-8 encoded, resulting in corrupted user input.
      Even request.setContentEncoding("UTF-8"); does not help, neither <form ... accept-charset="UTF-8" ...> does.

      Attachments

        Activity

          People

            Unassigned Unassigned
            holger.sunke@bodo-peters.de Holger Sunke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: