I have been wrestling with the same issue for a while. 

There are two ways to change the name of the file I have found that are
reliable:

1) The CFHEADER / CFCONTENT combo you may have already tried: 

        <CFHEADER NAME="Content-Disposition"
VALUE="attachment;filename=report.csv">

        <CFCONTENT TYPE="unknown"
reset="Yes"><cfoutput>#column_headers#</cfoutput>
        <cfoutput query="#queryname#">#col#
        </cfoutput>

On Netscape, this works without issue. On IE, when a user sees the 'What
would you like to do with this file?' dialog, it does read the name of the
CF file. However, when you go to save the file, the file name changes to the
value of the CFHEADER tag.

2) URL Hacking: 

Something such as: <a
href="index.cfm/report.csv?fuseaction=get_report">Click Here for File</a>

This method is very reliable for both browsers when the server decides it
should work. 

I have a development and test server, and the URL hack works perfectly in
dev but never in test. The installations are nearly identical and I am
completely lost for a solution. 

Hope this helps,
Mike


-----Original Message-----
From: Bosky, Dave [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 8:23 AM
To: CF-Talk
Subject: CFCONTENT & CFHEADER- filename problem?


I'm using CFCONTENT & CFHEADER to allow downloads but it always presents the
name of the cold fusion page instead of the file to be downloaded and saved?
Its being using on our intranet with only IE browsers.  I've seem several
different combinations of CFCONTENT & CFHEADER but none seem to replace the
name correctly.
I've used the examples from Figleaf as a guide but still no success.
 
Thanks,
 
Dave Bosky
 
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to