I have a query that I want to push to the user as a .CSV file. I have the
following code. I only create a temporary file, then I want it deleted after
the user downloads the file. This pushes the file to the user, but never
deletes the temporary file. I expected the 'deletefile="yes"' to delete the
tempoary file. What am I doing wrong?
<cfset externalName = "Report.csv">
<cfset internalName = GetDirectoryFromPath(GetBaseTemplatePath()) & "Reports\"
& CreateUUID() & ".csv">
<cffile file="#internalname#" action="write" .....>
....
<cfheader name="Content-Disposition" value="attachment;
filename=#externalname#">
<cfcontent type="application/msexcel" file="#internalname#" deletefile="yes">
rouwd - 31 Aug 2005 23:00 GMT
This sounds like a permission issue. Make sure the user that the CF services run can delete files in the directory with the .CSV file.
Rouwd