here's an update on this problem: bea.com tells me that their implementation of javax.portlet.ActionRequest.getContentLength() is currently hard-coded to return -1 ... still talking to bea to try to understand why... anybody experience the same thing? i would think that if bea, a leading portal provider, has a problem with this, then it must be a tricky problem to handle?? if any case, i would recommend the following change to the fileupload code: do not check the request content length if the maximum file upload is set to -1 (meaning no maximum) i believe fileupload checks the length in order to then check that the length is not greater than the maximum... this change, along with portlet setting file upload max to no limit (set to -1) in the PortletFileUpload instance, would provide a workaround for portal implementations that return an unspecified request content length thoughts? -- poc -----Original Message----- From: Martin Cooper <[EMAIL PROTECTED]> To: Jakarta Commons Users List <[email protected]> Sent: Tue, 10 Jan 2006 20:12:28 -0800 Subject: Re: FileUploadBase.UnknownSizeException
On 1/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > hello > > i'm working the latest version 1.1 of fileupload but i'm getting the > following error when i run my app (a java portlet) in bea weblogic 8.1, > sp5: > > org.apache.commons.fileupload.FileUploadBase$UnknownSizeException: the > request was rejected because it's size is unknown > > is fileupload not working right? That depends. If the request does not include a content length header, then FileUpload is working correctly. It cannot handle multipart requests unless the content length is specified. There is an existing enhancement request to add support for this case. However, this seldom comes up with browser clients. If the request _does_ include a content length header, then there might be an issue. You should also ensure that the request has not already been parsed by some other code before it reaches your code. -- Martin Cooper -- poc > ________________________________________________________________________ > Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading > spam and email virus protection. > > ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.
