[thelist] Anyway to set filename through response header?

Hassan Schroeder hassan at webtuitive.com
Wed Aug 18 13:49:36 CDT 2004


Chris Johnston wrote:

> Hello,
> 
> One more question concerning response headers. I am using struts and
> java to server up an excel file. However, when the user gets the file
> (which currently opens in their browser) the file is called
> createReport.do. Is there anyway, using the response header, to change
> the filename to foo.xls?

Something like:

response.setHeader("Content-Disposition","attachment;filename=\"foo.xls\""); 


:: should do it...

HTH,
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.




More information about the thelist mailing list