Muse Reader Asks:
"I am trying to use cfinclude to insert a txt file. But if the txt file has html / of cf code in it, i do not want it to be functional. can the txt file be read as a string?"
You know I love the easy ones. Your problem is misunderstanding the proper use of cfinclude. This tag passes the contents of the included file to the CF parser for execution. It's designed to compile into run time code. What you are trying to do is simply insert the contents of a file into the output buffer (the stuff that goes back to the browser). For that you can use cffile. Cffile will read the contents of your file into a variable - which you may then output onto the page. Here's an example.
<h4>output the contents of myfile</h4>
Notice the use of the expandPath() function. Unlike cfinclude which takes a relative Coldfusion path, cffile needs an absolute path. It needs something that looks like c:\inetpub\wwwroot\blah.txt (or maybe /var/home/www-data/blah.txt on a linux server). ExpandPath( ) is one of those can't-live-without-it functions that allows you to insert the path in a relative fashion.
In your question you indicated that you did not want the HTML to be "functional". I'm not sure what you mean by this - but I suspect you meant that you want the HTML to display on the page like "
" instead of like "this". For that you will need the htmleditformat( ) function as in...
I hope this helps.