You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Hilton <pe...@logicacmg.com> on 2003/12/08 10:50:55 UTC

RE: Setting browser download dialogue box captions and suggesting file names

To make a JSP respond as a CSV download I start the JSP like this:

<%
	response.setContentType("text/csv");
	response.setHeader("Content-Disposition", "attachment;
filename=some-data.csv");
%>

For Word, you probably need this:

<%
	response.setContentType("application/msword");
	response.setHeader("Content-Disposition", "attachment;
filename=my-document.doc");
%>

Peter Hilton
____________________________
LogicaCMG
Kralingseweg 241-249
Postbus 8566
3009AN Rotterdam
The Netherlands
www.logicacmg.com

All opinions expressed are solely those of the author and not of LogicaCMG


-----Original Message-----
From: Mike Parfitt [mailto:Mike.Parfitt@jmhdemica.com]
Sent: 01 December 2003 11:42
To: struts-user@jakarta.apache.org
Subject: Setting browser download dialogue box captions and suggesting
file names

[...] When a user clicks on one, a request is made to the server passing in
the ID of the chosen file (Microsoft Word) to be downloaded. [...] The file
is then downloaded to the user's browser (Internet Explorer - V5) but I
cannot find how to influence the caption/contents of the various dialogue
boxes [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org