• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Uploading

 
Joe Ridener
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am in the middle of a tutorial on Struts II. Although I have gone all over trying to get this program up and running I am still having the same exact problem and would have to believe that it is common. The error is that the it is not setting the File object in my sub-class of ActionSupport. my server console almost always says

INFO: Unable to find 'struts.multipart.saveDir' property setting. Defaulting to javax.servlet.context.tempdir

My Struts XML says this:



My Java Source code



I just threw this together very quickly. In previous attempts i followed the fileUpload's naming conventions far more strictly and still had the same result. So even though many of you may mention this it is most likely not the problem.
 
Joe Ridener
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yeah I forgot to mention that the File object is always null and does not exist.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know little about Struts, but my first check would be that "javax.servlet.context.tempdir" points to a directory that can be read and written by whatever user account the servlet container runs under, and that no security manager interferes with that.
 
Joe Ridener
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Close ... turned out the problem was you have to nest the interceptor-ref's a certain way. But my program does run now. And yes I created an images directory and download to there and it is better.


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic