cfcontent and download

I havent used cfcontent in years and forgot that if you don't want the name of the file to be a .cfm then use cfheader to push the desired file name e.g. so your create .csv Coldfusion page would look something like
<cfset fPath = expandPath('_view/') & "newFileName.csv" />

<cffile action="write" file="#fPath#" output="#csvData#" />
<cfheader name="Content-Disposition" value="filename=newFileName.csv" />
<cfcontent file="#fPath#" deletefile="true" type="application/csv" />

comments powered by Disqus