<cfconent...> and <cfheader...> are for delivering specified mine types to a client.
Your first idea was the correct one, <cffile....> is what you want to use to write content to the local server. I do not understand why you feel this was not the best tool.
What did you not like about cffile?
Thanks, but I can't find any good examples of using CFFILE (just syntax of the tag, which doesn't make a lot of sense). I've been writing CF code for 8 years, and feel I can make it sing and dance. But I didn't understand how CFFILE worked, from reading the online documentation and my Ben Forta books. There are no good examples. Do you still write the query with CFQUERY, then "substitutute" CFFILE for CFOUTPUT? Or enclose CFFILE inside CFOUTPUT? I can't find any examples that explain this.
I just need to see a basic example of CFFILE "in action." Starting with a simple query, and a simple output that writes the query results to a file.
Lastly, once you have the data written to a file, using CFFILE, is that when you can use CFFTP, to FTP that file, (or any file on the hard drive for that matter) to another server?
Thanks for help, and any simple examples, just to get me started. Thanks.
Here is one way. Surprisingly, the white space in the source code affected the file content.
<cfsavecontent variable="xx"><cfoutput query="x">#field1#|#field2#
<cffile file="#TheFile#" action="write" addnewline="no" output="#xx#" nameconflict="overwrite">