i want to implement file upload and download functioality in my application using struts2. i tried to use the examples from showcase and it seems to be working but they are static and i m not able to find some good example. if any body has implemented this functionality please share with me or post some good example.
I have few specific question.
1. when i m uploading a file what should be the path to store so that it can be downloaded also. should it be under tomcat or anywhere it can be saved.
2. when i am downloading a file it seems it should be under tomcat/webapp/project. that means it should be saved here only. i m not sure how will it work.
If any body have done it please help. it is very urjent.
To download file, the file should be present at the location where server is running because when any user will click on download button , the action present in server will be called and it will do whole processing .
I have done the same thing. In my application first of all i fetched the file from database and stored it in the location where tomcat server is running and then click of download button this this file will be downloaded.
Here is my code to save a file at server location :-