<< August, 2005 >>
SMTWTFS
123456
78910111213
14151617181920
21222324252627
28293031
Related Links
Search Blog

Categories
Archives
Photo Albums
RSS

Powered by
BlogCFM v1.1

01 August 2005

Note to self: Using CFCONTENT to force file download instead of display

Sometimes I see something useful and I know I'll never remember it, so I'm gonna post it here on my blog.

If you want to force download a document instead of displaying it inline (for example, a jpg image, or a word document (which IE will display inline!)), use the following code in a CFM file:

<cfheader name="Content-disposition" value="attachment;filename=test.jpg">
<cfcontent type="image/jpeg" file="D:\htdocs\filecabinet\test.jpg">
 

Poof!  Instant download dialog!

Posted by rickroot at 10:40 AM | Link | 4 comments