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

[fileupload] Fails to apply fieldname

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • 1.2
    • None
    • Operating System: All
      Platform: All

    • 38742

    Description

      Fileupload fails when parsing this example multipart request from RFC 1867. It
      appears that the attachmements "file1.txt" and "file2.gif" are associateed with
      the same form field name, "pics". However, since the name "pics" is specified in
      the content-disposition header on line [08], it is lost when the
      content-disposition header on lines [12] and [17] are parsed. The attachments
      are returned in the FileItem but the fieldName properties are null.

      I believe the name property from line [8] should be persisted and applied to
      both file parts (file1.txt and file2.gif).

      [01] Content-type: multipart/form-data, boundary=AaB03x
      [02]
      [03] --AaB03x
      [04] content-disposition: form-data; name="field1"
      [05]
      [06] Joe Blow
      [07] --AaB03x
      [08] content-disposition: form-data; name="pics"
      [09] Content-type: multipart/mixed, boundary=BbC04y
      [10]
      [11] --BbC04y
      [12] Content-disposition: attachment; filename="file1.txt"
      [13] Content-Type: text/plain
      [14]
      [15] ... contents of file1.txt ...
      [16] --BbC04y
      [17] Content-disposition: attachment; filename="file2.gif"
      [18] Content-type: image/gif
      [19] Content-Transfer-Encoding: binary
      [20]
      [21] ...contents of file2.gif...
      [22] -BbC04y-
      [23] -AaB03x-

      Attachments

        Activity

          People

            Unassigned Unassigned
            greg@evetts.org Greg Evetts
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: