So I have a report that I display in html, and hav...
# cfml-general
g
So I have a report that I display in html, and have an option to download as pdf. Now I need it MS word. This works in chrome: <cfheader name="Content-Disposition" value="attachment;filename=downloadReport.doc"> <cfoutput><!--- <META http-equiv="Content-Type" content="application/rtf;" /> ---> <html> <head> <title>Word</title> <link rel="stylesheet" type="text/css" href="#application.serverroot_secure#/docs/css/layout_print.css" src="#application.serverroot_secure#/docs/css/layout_print.css"> <meta http-equiv="Content-Type" content="application/msword"> </head> #fusebox.layout# </html> </cfoutput> But Firefox opens it with excel!
m
I know this is the easy way to trick word into opening the HTML version of the report, but working with an actual DOCX file is extremely easy and then you wouldn't have to have an html file named as a doc. I would however if you are going down this pathway use a cfcontent tag to set the Content-Type Header
Copy code
<cfcontent type="application/msword">