• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

commons-fileupload problem

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic