Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

How can I make the browser use the proper filename during a forced save, using CFCONTENT/CFHEADER

$
0
0

We have a client using CF8 Server for a site and I am using the CFHEADER/CFCONTENT method to force a file to save to the end-user's computer.

 

The dialogue comes up as expected, but regardless of what is found in the CFHEADER for a filename, it tries to save the file as the CFM page name.

 

i.e. The CFM page is signature.cfm. I am trying to make it save a TXT file to the user's computer, which it seems to be trying to do, but the instead of using "sig.txt" as the filename as outlined in the CFHEADER, it is defaulting to "signature.cfm"

 

While I know that I could change the name and extension and the content in the file would be correct, the mass majority of end-users will not know that they can do that, and the client does not want it to become more complicated than necessary.

 

Is there a way to make the file change to the proper name in the SAVE AS dialogue?

 

Thanks in advance.

 

Code so far is pretty straight forward ...

 

<CFHEADER name="Content-Disposition" value="attachment; filename=sig.txt">

<CFCONTENT type="application/unknown" file="#xf#">

 

 

 


Viewing all articles
Browse latest Browse all 14291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>