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

Add ability to get any header from the FileItem and FileItemStream interfaces

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2
    • 1.2.1
    • None

    Description

      The FileItem and FileItemStream interfaces should have a way to return back any header that was encountered during the header parsing for an "Item". Currently, from the FileItemStatus you can only get information from the 2 pre-defined headers "Content-Type" and "Content-Disposition" (Sort-of because the header can not be accessed raw). Other than the interface changes (including the change to pass them along in the FileItemFactory interface), it appears that all changes can be made within the FileUploadBase.java file. FileUploadBase.java:859 (as of 1.2) has the headers, but the call to create the FileItemStreamImpl on lines 877 and 887 do not include the headers map. Further, the parseRequest method uses the FileItemStream interface to build the FileItem, so you should always have the headers in question.

      The reason for this request is that we have an application that is sending per-part headers (not precluded by the specs as far as we know of) to provide more information than name and content-type and using the FileUpload project means that we can no longer find out those header values.

      [Also, not completely sure, but I believe FileUploadBase.createItem(Map, boolean) on line 480 is not referenced anymore in this project.]

      Attachments

        1. commons-fileupload-1.2.1-items-headers-issue.patch
          1 kB
          guillaume cottenceau
        2. FileUpload-130_1.patch
          43 kB
          Michael Macaluso
        3. FileUpload-130_2.patch
          36 kB
          Michael Macaluso
        4. FILEUPLOAD-130.patch
          16 kB
          Jochen Wiedmann

        Activity

          People

            jochen@apache.org Jochen Wiedmann
            michael.public@wavecorp.com Michael Macaluso
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: