Cold Fusion wrote:

> 
> What we want to do is have the user click a link to a cfm file, that cfm
> file then returns a file (for arguements sake a .xls file) which starts to
> download to the users machine (forcing download rather than returning to
> browser).


There is no way to force a download in HTTP. You can only imply the 
suggestion of a download by setting the type to 
"application/octet-stream" in your cfcontent tag.


> We've tried using CFCONTENT and setting the type to unknown, this will
> start the file downloading all right but the name that appears in the
> dialog boxes is the name of the orginal cfm file that was called rather
> than the name of the actual file (i.e. saves as "download.cfm" rather than
> "file2download.xls" )


To get the right filename add a cfheader:
<cfheader name="Content-Disposition" value="attachment; 
filename=#chr(34)#fname.ext#chr(34)#">

Jochem



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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