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

UnknownSizeException with IE5.0 (due to IE5.0 bug)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0 Final
    • None
    • None
    • Operating System: other
      Platform: All

    • 28085

    Description

      When redirect is sent by application after POST of multipart/form-data form:

      HTTP/1.1 302 Moved Temporarily
      Location: http://karel:81/inzert/app?service=page/BulletinOrders
      Content-Type: text/plain
      Content-Length: 0
      Date: Wed, 31 Mar 2004 08:37:38 GMT
      Server: Apache Coyote/1.0

      IE5.0 sends invalid header Content-type with its GET request:

      GET /inzert/app?service=page/BulletinOrders HTTP/1.1
      Content-Type: multipart/form-data; boundary=---------------------------
      7d43892c1c010e
      User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
      Host: karel:81
      Connection: Keep-Alive
      Cache-Control: no-cache

      Which will cause
      org.apache.commons.fileupload.FileUploadBase$UnknownSizeException.

      Solution:

      FileUploadBase.isMultipartContent(HttpServletRequest req) should ensure that
      the request method was POST and not only see the Content-type header:

      public static final boolean isMultipartContent(HttpServletRequest req)
      {
      String contentType = req.getHeader(CONTENT_TYPE);
      if (contentType == null)

      { return false; }

      if (contentType.startsWith(MULTIPART) && "POST".equals(req.getMethod
      ().toUpperCase()))

      { return true; }

      return false;
      }

      Regars,
      Karel

      Attachments

        Activity

          People

            Unassigned Unassigned
            karel.miarka@issa.cz Karel Miarka
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: