File Upload in Struts 2.0 example
Posted on 2011-05-10
I am using the File Upload tag of struts 2.0....
<s:file name="filePath" label="Upload Course File" value="filePath" />
filePath is the vaiable in action class .. whenever i upload the file.. then i am accessing the filePath in respective action classs.. but i am getting the fileName of the pdf(which i have uploaded)... how to get the full path of the file and how to save it....
My requirement is to save the file in some holder and need to display in display tag and the title should be "View file" , when the user clicks on the "view File".. the uploaded file should be opened.. how can i achieve this.