This worked for us (IE was the problem for us tho) and remember and
change the content type

<!--- TO FORCE A DOWNLOAD--->
<cfset sFileName = "IFormData_" & dateformat(now(),"yyyymmdd") &
timeformat(now(),"HHmm") & ".csv">
<!--- IE 5.5 has bug and need to give it slightly diff header info --->
<cfif FindNoCase("MSIE 5.5",CGI.USER_AGENT) GT 0>
        <cfheader name="content-disposition"
value="filename=#sFileName#">
<cfelse>
        <cfheader name="content-disposition" value="attachment;
filename=#sFileName#">
</cfif>
<cfcontent type="text/comma-separated-value">

HTH

> -----Original Message-----
> From: Matt Kornguth [mailto:[EMAIL PROTECTED] 
> Sent: 13 June 2003 15:12
> To: CF-Talk
> Subject: Force download of file
> 
> 
> Alright, I'm sure I'm missing something simple, but ... I'm 
> trying to force a file download using the following code in a 
> template called
> force_download.cfm:
>  
> <CFSET filename = "test.pdf">
> <CFSET fullpath = "c:\test.pdf">
> <CFHEADER name="Content-Disposition" value="attachment; 
> #variables.filename#"> <CFCONTENT type="unknown" 
> file="#variables.fullpath#" deletefile="No">
>  
> I get a File Download dialog box, but it is prompting to 
> download the cfm file (force_download.cfm) instead of test.pdf.
>  
> I found the following article at Macromedia, but had the same 
> results when implementing the code changes indicated. 
> http://www.macromedia.com/support/coldfusion/ts/documents/tn>
17216.htm
>  
> Any help would be greatly appreciated,
>  
> Matt Kornguth
> Web Applications Developer
> BLR.com
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

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

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to