Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

package com.oreilly.servlet.* users!  RSS feed

 
Phil Chuang
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody have much experience with file uploading using this package?
I'm having a problem getting a MultipartRequest object to instantiate.
Before, everything was working when I was just going straight to a servlet that knew it was processing a multipart request. I had successfully gotten file uploading to work.
Now, I am going with a more strict MVC-architecture- so in my controller servlet, I am checking for multipart type- if not, I continue as normal, but if it is, then I use MultipartParser to parse through the multipart request and extract a parameter. I use the parameter to decide which workflow to follow. The problem is that now I get the following error:
java.io.IOException: Corrupt form data: premature ending
when I try to instantiate the MultipartRequest.
My best guess right now is that maybe the MultipartParser "eats" the request object as it's parsing? This doesn't sound likely to me, but it's the only thing I can think of - since the MultipartRequest works fine if I go directly to it instead of parsing it first...
So, any ideas?
 
Phil Chuang
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
disregard, I did some digging on the oreilly site, it turns out that MultipartParser does eat the request, so you can use both MultipartParser and MultipartRequest on the same object. I'm just going to use the MultipartWrapper/Filter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!