This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes problem in file downloading in struts 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in file downloading in struts 2.0" Watch "problem in file downloading in struts 2.0" New topic
Author

problem in file downloading in struts 2.0

Manish Shinde
Ranch Hand

Joined: Mar 30, 2011
Posts: 39
I have some facing some problems in downloading the file.
Earlier I was getting following error :

Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the <param name="inputName"> tag specified for this action.

Which is resolved when I specified name of method(getInputStream()) in action tag of struts.xml. This getInputStream() wiil return InputStream object.

Now when I clicked on download I m getting blank page with following URL

http://localhost:8080/struts2/JSP/download.action?filePath=D%3A%2Fmanish235%2Fstruts2%2Fbuild%2Fweb%2FWEB-INF%2F479391_rp_rp023_objctn_lr.PDF in browser.

If code is working that file should be saved in download folder in disk but I didn’t get the file in that location.

Then what could be the issue with the code? I didn’t get any error.

Following is code where I am uploading the file then I am downloading the same file.

1)UploadForm.jsp











Thanks in advance
Manish


 
 
subject: problem in file downloading in struts 2.0