aspose file tools*
The moose likes Other Open Source Projects and the fly likes commons-fileupload problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "commons-fileupload problem" Watch "commons-fileupload problem" New topic
Author

commons-fileupload problem

Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
I am using commons fileupload and am getting the following error when I try to upload a file larger than 50KB:

org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:429)

using the following code:

// Create a new file upload handler
DiskFileUpload upload = new DiskFileUpload();

// Set upload parameters
upload.setSizeThreshold( 5*1024 );
upload.setSizeMax( this.getMaxUploadSize() );
upload.setRepositoryPath( application.getRealPath( getSetting( "upload_path" ) ) );

// Parse the request ( Throwing the error )
List items = upload.parseRequest( request );


http://www.goodercode.com
SCJP 1.4
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
a 56KB file throws the error, but a 54 KB file does not.

I think it has something to do with the whole request not being received, however I am accessing over a network connection so it should be fast, I can only imagine what it will be like once I post to a production server.

btw, the max upload is set to 10MB, so that is not the problem.
[ April 05, 2005: Message edited by: Kerry Wilson ]
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
jk2 connector has a bug in it. Fixed it by turning logging to DEBUG in the workers2.properties file. If anyone has a real fix, let me know.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: commons-fileupload problem