File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes problem with download file using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with download file using struts" Watch "problem with download file using struts" New topic
Author

problem with download file using struts

Satish Kumar
Ranch Hand

Joined: Oct 16, 2006
Posts: 84
i am using struts to download a file.
in the link for downloading file in order to open in a new browser i have user target="_blank" in ahref tag
<a href="path" target="_blank">
the following code opens a pop asking for open save and cancel dialog
response.setHeader("Content-disposition", "attachment; filename="
+ oSWFDownloadVO.getStrFileName())
when i click on save , it opens a blank browser window. is there any way to close the blank browser window when save is clicked.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just remove target="_blank". Since you've specified that it is an attachment, even if the user selects "open", it will be opened in a new window anyway.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with download file using struts
 
Similar Threads
OPEN/SAVE popoup box comes twice
Open an XML file in a popup window
Force a file download in HTML
.xlsx file not uploading properly
Download jpg's from browser