Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-179

Bug in file upload with IE 5

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0 Beta 1
    • Fix Version/s: 1.0.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • Bugzilla Id:
      1725

      Description

      Actually, this is a bug in IE 5 that causes a failure in the Struts file upload
      code.

      When a POST request is submitted from IE 5, and the server sends a redirect
      response (HTTP 302), IE will turn around and issue a GET request to the URL
      specified by the Location header. That's normal. The bug in IE 5 is that the
      GET request will still contain "Content-Type: multipart/form-data", which is
      obviously wrong.

      The problem this causes in Struts is that the code to determine whether the
      request is multipart or not acts solely on the basis of the Content-Type
      header. In the face of a bogus request from IE 5, Struts barfs (i.e. results in
      a ServletException).

      My proposal for fixing this is to have Struts ensure that the request method is
      POST, in addition to the content type being multipart/form-data, before
      declaring the request to be multipart. Alternatively, it could ensure that the
      method is not GET. This is safe because a GET request cannot have a body, so
      the Content-Type header is clearly bogus in such a case.

        Attachments

          Activity

            People

            • Assignee:
              mschachter@bluestone.com Mike Schachter
              Reporter:
              martin.cooper@tumbleweed.com Martin Cooper
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: