Here is what needs to be done
1. use the "name" variable in cfchart and type as jpg or png.
<cfchart type="jpg" name="whatever">
--- Chart stuff here ---
</cfchart>
2. Then do the following, write the entire content to the file
<cfset savedFile = getTempFile(getTempDirectory(),"Download") & ".jpg">
<cfset fileWrite(savedFile, whatever)>
3. Force the header for download
<cfheader name="Content-Disposition" value="attachment;filename=download.jpg">
<cfcontent type="image/jpeg" file="#savedFile#">
Thats ALL :-)
2 comments:
can i do it to cf7?
please do email me for the answer since i cant monitor this thread or please email me if you answer the question with the link. thank you very much.
You should be able to do it with ColdFusion 7, CF 7 supports cfchart output as binary data, so it would work
Post a Comment