[thelist] Force download in ColdFusion?

Seth Bienek seth at sethbienek.com
Thu Feb 22 15:30:44 CST 2001


Doh!  Don't you hate it when you miss and hit alt-enter instead of alt-tab,
then enter?

Anyhoo...  I didn't test it, but here's your perl code translated:

<!--- Turn off any unneccesary output. --->
<cfsetting enablecfoutputonly="yes">

<!---
  open (FILE, "/path/to/file");
  local ($/);
  $file = <FILE>;
  close (FILE);
--->
<cffile action="ReadBinary" file="/path/to/file" variable="Foo">

<!---
  print "Content-type: application/x-unknown\n";

--->
<cfcontent type="application/x-unknown" reset="no">

<!---
  print "Content-Disposition: attachment; filename=file.tsv\n";
  print "Content-Description: This is a tab-delimited file.\n\n";
--->
<cfheader name="Content-Disposition" value="attachment;
filename=file.tsv"><cfheader name="Content-Description" value="This is a
tab-delimited file.">

<!---
  print $file;
--->
<cfoutput>#Foo#</cfoutput>

Lemme know how it works out!


Seth

------------------------------
Seth Bienek
Solutions Development Manager
Stonebridge Technologies, Inc.
972.455.7294 tel
972.404.9754 fax
ICQ #7673959
------------------------------

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of Minh Lee Goon
> Sent: Thursday, February 22, 2001 2:12 PM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] Force download in ColdFusion?
>
>
> > I'm looking for a way to do the same thing in ColdFusion, can
> anyone provide
> > pointers or a sample?
>
> Because no CF code is given back to the web server by the CF server, I
> don't think there really is a way that CFML will force the file to
> download. The best you can do, I suppose, is to insert a paragraph of
> instructions for downloading the file (i.e. hold down SHIFT and click
> the link etc.)
>
> </ml>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
>






More information about the thelist mailing list