Issue Details (XML | Word | Printable)

Key: FILEUPLOAD-53
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Karel Miarka
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons FileUpload

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

Created: 31/Mar/04 06:45 PM   Updated: 30/Oct/06 09:53 PM
Return to search
Component/s: None
Affects Version/s: 1.0 Final
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: other
Platform: All

Bugzilla Id: 28085
Resolution Date: 30/Oct/06 09:53 PM


 Description  « Hide
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



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.