[thelist] ColdFusion: Forcing Download

Susan Wallace susanhw at webcastle.com
Mon Apr 15 20:04:00 CDT 2002


Hi Jon,

 >>How can I force a download of a pdf file with ColdFusion, rather than
Adobe displaying the file in
 >>the browser?

I am not positive this will work, but if you want to use CFContent, try
setting your MIME type to:

<CFSET FileType = "unknown">

I am basing this guess on one of my templates where to send them the PDF, I
set the Mime type to
<CFSET FileType = "application/pdf">

and then my CFContent syntax is:

<CFCONTENT TYPE="#FileType#" FILE="Your File">

which becomes:

<CFCONTENT TYPE="unknown" FILE="Your File">

Alternately, try changing the settings on your web server so that it does
not know what a PDF is... it's in the MIME settings, some servers refer to
them as Document Types. If that's more along the lines of what you wanted,
let us know what Web server you are using and I am sure someone can point
you in the right direction for setting that. (Keep in mind that if you set
that for your entire server and it is successful, it will be successful
throughout the server.)

Hope this helps some!
Susan Wallace










More information about the thelist mailing list