There are several different themes playing there. I would separate them, making the code scalable and more manageable.
Using your code, I have set up the following quick test. It uses the in-built datasource, cfartgallery, which you also have.
I placed the 3 files in the same directory. But this is in general unnecessary because you can pass the directory's path as a variable.
fileWrter.cfm
<!--- This page writes the file to be downloaded --->
<cfquery name="myQuery" datasource="cfartgallery" >
select city, email
from artists
</cfquery>
<!--- Details of the file to be written to disk --->
<cfset f_dir = getDirectoryFromPath(expandPath('*.*'))>
<cfset f_name = dateformat(now(), 'mmddyy') & timeformat(now(), 'hhmm')>
<cfset f_extension = "csv">
<cfset f_path = createobject("component", "File").getPath(f_dir,f_name,f_extension)>
<cffile action="WRITE" file="#f_path#" output="field1,field2" addnewline="Yes">
<cfloop query="#myQuery#">
<cffile action="append" file="#f_path#" output="#city#, #email#" addnewline="Yes">
</cfloop>
<cfset queryString = "?f_name=" & f_name & "&f_extension=" & f_extension>
<!--- I use a relative path so that the download link with be translated into a relative URL --->
<cfset downloadRelativePath = "fileDownload.cfm" & queryString>
<cfoutput><a href="#downloadRelativePath#">Here is the file</a></cfoutput>
fileDownload.cfm
<!--- The URL identifies the file to be downloaded --->
<cfif isDefined("URL.f_name") and isDefined("URL.f_extension")>
<cfset dir = getDirectoryFromPath(expandPath('*.*'))>
<cfset name = URL.f_name>
<cfset fileExtension = URL.f_extension>
<cfset downloadFileName = name & "." & fileExtension>
<cfset downloadFilepath = createobject("component", "File").getPath(dir,name,fileExtension)>
<cfheader name="Content-Disposition" value="attachment; filename=#downloadFileName#">
<cfcontent type="application/vnd.msexcel" file="#downloadFilepath#">
<cfelse>
You first have to create the download file.
</cfif>
File.cfc
<!--- File component, which may be shared by multiple CFM pages --->
<cfcomponent>
<cffunction name="getPath" output="false" returntype="string">
<cfargument name="dir" type="string" required="yes">
<cfargument name="fileName" type="string" required="yes">
<cfargument name="extension" type="string" required="yes">
<cfset var filePath = arguments.dir & arguments.fileName & "." & arguments.extension>
<cfreturn filePath>
</cffunction>
</cfcomponent>