commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guhn Chang" <sticma...@hotmail.com>
Subject FileUploadException - the request was rejected because it's size is unknown
Date Tue, 05 Jul 2005 15:41:20 GMT
I am using the FileUpload 1.1 library in Weblogic 8.1 SP4, and am trying to 
get uploading to work in portlets.  Whenever I try to parse my multipart 
content, I get an exception with the message "the request was rejected 
because it's size is unknown".




Here are some relevant code snippets.



public void processAction(ActionRequest request, ActionResponse
response) throws PortletException
{
if (PortletFileUpload.isMultipartContent(request))
{

DiskFileItemFactory factory = new DiskFileItemFactory();
PortletFileUpload upload = new PortletFileUpload(factory);

try
{
List fileItems = upload.parseRequest(request);
FileItem item = (FileItem)fileItems.iterator().next();
File uploadedFile = new File(type + item.getName());
item.write(uploadedFile);
}
catch (Exception ex)
{
System.out.println("EXCEPTION: File upload request error:
" + ex.getMessage());
//ex.printStackTrace();
return;
}

...



My jsp file contains:

<form action="<portlet:actionURL />" method="post"
enctype="multipart/form-data">
<table width="100%" cellspacing="0" cellpadding="3" >
<tr>
<td>Title</td>
<td> <input type="text" name="title"></td>
</tr>
<tr>
<td>Description</td>
<td> <input type="text" name="description"></td>
</tr>
<tr>



<td>File</td>
<td> <input type="file" name="upfile" ></td>



</tr>
</table>
<input type="submit" name="doUpload" value="upload"/>
<input type="submit" name="cancel" value="cancel"/>
</form>



I have tried this with size set and unset in  the "<input type="file"" 
section.

I have tried several forums already and gotten no responses.  Any 
direction/help would be appreciated.



-Guhn Chang
sticman77@hotmail.com



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


Mime
View raw message