File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes struts file upload example code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts file upload example code" Watch "struts file upload example code" New topic

struts file upload example code

dave sag
Ranch Hand

Joined: Feb 17, 2003
Posts: 47
I have been asked to implement simple photo upload and resizing in our struts 1.1b3 web application and I am having trouble finding any example code. Google gives me links the javadocs which is nice but not that useful. Could some kind soul post a few links to some decent, simple example code? TIA dave.

JSF / Jini / Javaspaces / JDO - all rock in my opinion.
dave sag
Ranch Hand

Joined: Feb 17, 2003
Posts: 47
Okay time for me to answer my own question again, with thanks to Rajani Deshpande for pointing out the obvious that I should have looked in the example code that came with struts, notably in struts-upload.war
so now my issue is slightly different. i have my site accepting uploads okay but for some reason by default it puts the files in $TOMCAT_HOME/bin which is hardly where I would have expected it to end up.
how do i specify in a fairly general way where i expect the file to go? it needs to be general as I work on my own laptop, deploy to a staging server and then eventually deploy to a live server. i don't want to have to rebuild for each deployment, but expect the .war file to be transportable.
TIA - dave.
I agree. Here's the link:
subject: struts file upload example code
Similar Threads
Struts Help
Struts2 issue
How to store the PDF file in the server side?
Problem in inserting image in Struts 1