I am not sure if this is what you are wanting, but I do a cffile to create
csv files all the time.

Then the file is appended too with each outputted line of your query.

Larry Juncker
Senior Cold fusion Developer
Heartland Communications Group, Inc.
[EMAIL PROTECTED]
(515) 574-2122

CONFIDENTIALITY NOTICE
The information contained in this e-mail is intended only for the use of the
individual or entity to which it is addressed.  This e-mail may contain
information that is privileged, confidential and/or personal.  If the reader
of this message is not the intended recipient (or the employee or agent
responsible to deliver it to the intended recipient), you are hereby
notified that any dissemination, distribution, or copying of this
communication is prohibited.

If you have received this communication in error, please notify us at the
e-mail listed above.

-----Original Message-----
From: David Sampson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:50 PM
To: CF-Talk
Subject: CFCONTENT Problem


Once again I find myself running to you for help!  Boy am I glad you're
here!

Okey doke; I want to push the results of a query out to a delimited list (or
excel, or ms word) such that someone can click on a link and download a .txt
(.xls, .doc) file.

I'm able, using cfcontent tag to create a list and make it available for
download as a .cfm file.  How do I get it to download as a .txt (.xls,
.doc)?

Here's the code for my test page:

<.!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<.cfparam name="do" default="not yet">

<.cfif DO is not "not yet">
<.cfcontent type="application/msexcel">
<.CFQUERY NAME="qryCountries" DATASOURCE="Country">
SELECT      PK, CC, Country
FROM         dbo.tblCountries
</CFQUERY>
"PK","CC","Country"
<.cfoutput query="qryCountries">
"#PK#","#CC#","#country#"
<./cfoutput>
<./cfif>
<.html>
<.head>
        <title>TESTER</title>
<./head>

<.body>
here's a test of the cfcontent tag.<br>


<.a href="testpage.cfm?do=now">Country Codes</a>


<./body>
<./html>

This pulls a list of countries with their codes in a comma delimited list
but tries to save it as "testpage.cfm" not .txt (or .xls as you'd expect
from the mimetype of msexcel).

Thanks in advance for all your help,
David
David Sampson
Analyst/Programmer II
AK Department of Education & Early Development
[EMAIL PROTECTED]


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to