commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28085] New: - UnknownSizeException with IE5.0 (due to IE5.0 bug)
Date Wed, 31 Mar 2004 10:45:05 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28085>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28085

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

           Summary: UnknownSizeException with IE5.0 (due to IE5.0 bug)
           Product: Commons
           Version: 1.0 Final
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: File Upload
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: karel.miarka@issa.cz


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

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message