[thelist] Force download in ColdFusion?

Pete Prodoehl pete.prodoehl at cygnusinteractive.com
Thu Feb 22 11:49:59 CST 2001


In perl I've used the following hack:

  #!/usr/local/bin/perl

  open (FILE, "/path/to/file");
  local ($/);
  $file = <FILE>;
  close (FILE);

  print "Content-type: application/x-unknown\n";
  print "Content-Disposition: attachment; filename=file.tsv\n";
  print "Content-Description: This is a tab-delimited file.\n\n";
  print $file;


to present a "Save As..." dialog box and force the download of a file,
rather than have it displayed within the browser.

I'm looking for a way to do the same thing in ColdFusion, can anyone provide
pointers or a sample?

Thanks...

Pete





More information about the thelist mailing list