Much thanks to all for your help. I implemented Brendan's idea and it
worked.
We had to save these things in text files because they are press
releases and had to be kept that way. The client wanted a "Download
now" button that was actually a hyperlink that was supposed to simply
download the file. The client was also very insistent that the page not
submit to a "Confirmation" page and wanted it to look as if it "just did
it without bouncing through a whole bunch of pages" So, I used a cfif
block to look for a certain parameter and passed the successful value
back through the same template and then executed the code as Brendan
suggested. So it ended up like this.
<cfif thisvariable eq "true">
<cfheader NAME="Content-Disposition" VALUE="inline;
filename=whateveryouwanttheresultingfilenametobe.txt">
<cfcontent type="application/superrandomnoway"
file="#expandpath("test.txt")#" deletefile="No">
</cfif>
..
<a
href="http://www.thispage.com/thispage.cfm?thisvariable=true"><img
src="images/downloadimage.jpg"></a>
Thanks again everyone for your help. I actually still have four hairs
left on my head. I plan on growing them really long and then doing a
combover.
Michael Corrigan
Programmer
Endora Digital Solutions
1900 S. Highland Avenue, Suite 200
Lombard, IL 60148
630/627-5200 x-136
630/627-5255 Fax
----- Original Message -----
From: Brendan Avery
To: CF-Community
Sent: Tuesday, January 15, 2002 6:30 PM
Subject: RE: Download Text file - HAHAHA
<cfheader NAME="Content-Disposition" VALUE="inline;
filename=whateveryouwanttheresultingfilenametobe.txt">
<cfcontent type="application/superrandomnoway"
file="#expandpath("test.txt")#" deletefile="No">
i chose application/superrandomnoway cause it's unlikely to launch any
related apps.
-----Original Message-----
From: Todd [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 15, 2002 15:14
To: CF-Community
Subject: Re: Download Text file
I guess you could use <cfcontent> and set some mime type that would
normaly
cause a download prompt.
Todd
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Community" <[EMAIL PROTECTED]>
Sent: Tuesday, January 15, 2002 4:47 PM
Subject: Download Text file
> OK, I know this is an HTML 101 question, but I can not for the life
of
> me remember how to do this. How can I download a text file by
simply
> allowing the user to click on a link? Normally, you just treat it
like
> any other non html file and the browser will invoke the explorer
window
> and give you the change to "Save as..." but the .txt file just shows
up
> in the browser. Anyone? Bueller? Bueller?
>
> Thanks all,
>
> Michael Corrigan
> Programmer
> Endora Digital Solutions
> 1900 S. Highland Avenue, Suite 200
> Lombard, IL 60148
> 630/627-5200 x-136
> 630/627-5255 Fax
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists