Mark,

I do a similar thing all the time.  What you do is put your HTML output into
a variable, then you write the contents of the variable to a file.

<CFSET temp = "">

<CFOUTPUT QUERY="myQuery>
<CFSET temp = ListAppend(temp, "<HTML><HEAD><TITLE>#myPageTitle#</TITLE>",
"^")>
<CFSET temp = ListAppend(temp, "<BODY><TABLE><TR><TD>", "^")>
 . . . .  So on and so forth
Just remember to double quote any quotes in the HTML you're building to
escape them.  Example would be in HTML tags.

I like using a carrot "^" for a delimiter because it's rater unique and
hardly ever used in a page.  If it is, then you have to use something else.

Then you write the "temp" variable to an HTML file:

<CFFILE ACTION="WRITE"
              FILE="d:\inetpub\wwwroot\yourdirectory\somefile.html"
              OUTPUT="#Replace(temp, "^", "#Chr(13)#", "ALL")#"
              ADDNEWLINE="No">

Works like a charm.

Dave


----- Original Message -----
From: "Mark Leder" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, March 12, 2002 10:52 AM
Subject: Creating a file from a web page


I want to take a query output, format it as HTML page and save it as a
downloadable HTML document.  I don't need to display the page in the browser
window.

1) Would CFSilent hide the HTML from view?

2) How would I create the HTML file, in other words:
c:\inetput\mysite\docs\filedate_filetime.htm  (I know how to do the
filedate_filetime).  Would I Use CFFile, or is there a better mechanism?

Thanks,

Mark Leder
[EMAIL PROTECTED]


______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to