You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ex...@dinosol.es on 2005/11/17 12:44:02 UTC
Donwload files
Hi,
I have a appli lets download a file. My problem is what dialog box show as
file name 'anything.do' instead real file name.
I remenber to read something about this, but I don't now know where....
Anyboy can remenber it?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Donwload files
Posted by Martin Gainty <mg...@hotmail.com>.
you have to setContentType to application/x-download
then set the Content Dispostion to attachment
// Set the headers.
res.setContentType("application/x-download");
res.setHeader("Content-Disposition", "attachment; filename=" + filename);
// Send the file.
OutputStream out = res.getOutputStream( );
returnFile(filename, out); // Shown earlier in the chapter
Verdad?
M-
----- Original Message -----
From: <Ex...@dinosol.es>
To: <us...@struts.apache.org>
Sent: Thursday, November 17, 2005 6:44 AM
Subject: Donwload files
> Hi,
>
> I have a appli lets download a file. My problem is what dialog box show as
> file name 'anything.do' instead real file name.
> I remenber to read something about this, but I don't now know where....
>
> Anyboy can remenber it?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org