Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

CF 10 cfcontent application/msword displays HTML code instead of document?

$
0
0

I have this code for a generic template:

   <cfset fileName="c:\temp\wordTmpDoc"&randRange(1,100000)&".htm">

    <cfif fileExists(fileName)><cffile action="delete" file="#fileName#"></cfif>

    <cfsavecontent variable="htm"><CFINCLUDE template="#incl#.cfm"></cfsavecontent>

    <cffile action="write" file="#fileName#" output="#htm#">

    <cfcontent file="#fileName#" deletefile="no" type="application/msword">

Note the CFINCLUDE. I also have another template that goes through generating the html in a cfsavecontent and at the bottom it has essentially the same code but uses the HTML generated on the page as the content for the document. The above generic version brings up MS Word but the content is the HTML code, while the page that has local cfsavecontent wrapping the HTML, the document displays properly.


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>