[jboss-user] [JBoss Portal] - Re: Downloading a File from within a Portlet.
analyzediz
do-not-reply at jboss.com
Mon Nov 17 11:23:14 EST 2008
Thank Chris! I was able to use your suggested approach and got the browser to respond with a "Save as" dialog box.
The only strange thing that I noticed is that the filename sent back to the browser is not the one that I set on the header. Here's a code sample:
response.setContentType("text/x-vcard");
|
| response.setProperty("Content-Disposition", "attachment; filename=" + personDetails.getFirstName() + "_" + personDetails.getLastName() + ".vcf");
|
| response.getPortletOutputStream().write(vCardData.getBytes());
Essentially the filename in the browser should be of the format: Firstname_Lastname.vcf
But instead the Portlet window name is used as the name of the file to be downloaded.
Any thoughts on why this might be occuring?
Thanks again for the help...much appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189847#4189847
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4189847
More information about the jboss-user
mailing list