I've tried this code but the file doesn't seem to download.
It gets saved to the server ok though.
<cffunction name="downloadCSV" access="remote"
returntype="void">
<cfargument name="data" type="string" required="yes">
<CFFILE ACTION='Write'
file="#expandPath('../userData/data.csv')#" OUTPUT='#data#'>
<cfset yourFileName="data.csv">
<cfcontent type="application/x-unknown">
<cfheader name="Content-Disposition"
value="attachment;filename=#yourFileName#">
<cfheader name="Content-Description" value="This is a
tab-delimited file.">
<cflocation
url="#expandPath('../userData/data.csv')#">
</cffunction>