1

I have a report which is enclosed in a cfsavecontent tag.

<cfsavecontent variable = "testcust"> 

When I use

<cfoutput> #testcust# </cfoutput>  

the report renders correctly. When I use cffile to save it to disk I lose the css formatting:

<cffile action = "write"
file   = "/var/www/reports/testcust.cfm"
output = "#testcust#">

I can run testcust.cfm and it produces the report. All in-line styling is preserved. But formatting from the style sheet is not there. Does anyone know how to fix this?

Betty Mock
  • 1,373
  • 11
  • 23

1 Answers1

0

You need to escape the html special characters. e.g < for &lt; and > for &gt;

So replace them before writing to file.

Miguel-F
  • 13,450
  • 6
  • 38
  • 63
  • 1
    *e.g `<` for `<`* Not sure what you mean. That is the opposite of escaping. If you meant the reverse, that would cause tags to be displayed rather than evaluated. – Leigh Jun 06 '13 at 22:29
  • yes the reverse. I meant replace `<` with `<` and replace `>` with `>` . This would allow the tags symbol to remain in the output file instead of being evaluated. – user2461235 Jun 12 '13 at 08:52