Thanks Dave. That works.
Now I build the file, read the file as binary, delete the physical file, and
serve the file from memory. It's secure I don't have to worry about leaving
unprotected data on disk.
<cfset
getfile="#application.rootpath#\admin\custom1\tempfiles\#file_name#.zip">
<cfset file_size="#getFileInfo(getfile).size#">
<cffile action="readBinary" file="#getfile#" variable="serve_file">
<cfdirectory action="list"
directory="#application.rootpath#\admin\custom1\tempfiles\" name="to_purge">
<cfloop query="to_purge">
<cffile action="delete"
file="#application.rootpath#\admin\custom1\tempfiles\#to_purge.name#">
</cfloop>
<cfheader name="Content-Disposition"
value="attachment;filename=#file_name#.zip">
<cfheader name="Content-Length" value="#file_size#">
<cfcontent type="application/zip" variable="#serve_file#">
<cfheader name="Pragma" value="no-cache">
<cfheader name="Expires" value="#Now()#">
<cfheader name="cache-control" value="no-cache, no-store,
must-revalidate, max-age=0">
Robert Harrison
Director of Interactive Services
Austin & Williams
Advertising I Branding I Digital I Direct
125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788
T 631.231.6600 X 119 F 631.434.7022
http://www.austin-williams.com
Blog: http://www.austin-williams.com/blog
Twitter: http://www.twitter.com/austin_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353121
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm