• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Upload - ServletFileUpload comes up empty  RSS feed

 
Bruce Steinback
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Sorry to bother, but I've hit a wall on this one. I'm trying to upload a file using a Struts servlet, but ServletFileUpload comes up with an empty list. Here's my code:



I looked at the response using Fiddler and it looked fine (I can include if if people think it's useful).

So I put in all the log statements to try to figure out what went wrong, but they all look fine:
RequestType = POST
Req content-type is: multipart/form-data; boundary=----WebKitFormBoundaryfgssIVuNZTKaXZpA
req length=234315
file dir = C:\Program Files\tomcat5\apache-tomcat-5.5.28\temp
SizeMax & FileSize are both -1 (should mean no limit, right?)

Anyone have any idea what I'm doing wrong? There's a note about parseRequest() coming up empty if the request has already been processed. Could this be because of Struts (using Struts 2)? If so, anyone know any way around that?

Many thanks in advance,
Bruce
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why aren't you using the existing S2 file upload capability?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!