Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

commons-fileupload problem

 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 );
 
Kerry Wilson
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic