Struts Action - Download File - Forward to JSP
843841May 20 2005 — edited Jan 11 2008I am writing a struts application. I have a jsp that has a multiple links to an Action.
The action must grab a file from an archive database. Write the file to a temp directory. Then write the client to the response so that the user can open/save the file. Then delete the file from the temp directory and forward to a notification screen.
I already have written the link, written the code in a servlet to get the file and write it to a temporary dir and delete it at the end of the action. However, I can not seem to allow the client to open/save the file.
Can anyone please help me write a java.io.File to the the client response so that it can be saved.
Thanks,
DeltaCoder