Since I can't password protect a zip file I need to protect, I'm trying a
different approach. I build the file, read the content with CFFILE (this
works), delete the file, then try to server it out with CFHEADER.
When I have a physical file CFHEADER serves it fine, but when I try to serve it
from the CFFILE READ variable it don't serve. Any idea what I'm doing wrong?
<cfset getfile="mypath\myfile.zip">
<cfset file_size=getFileInfo(getfile).size>
<cffile action="read" file="#getfile#" variable="serve_file"> (This
works; I can dump the file var and binary content is there)
... would delete the file here...
To serve the file:
<cfheader name="Content-Disposition" value="attachment;filename=
myfile.zip">
<cfheader name="Content-Length" value="#file_size#">
<cfcontent type="application/zip" file="#serve_file#"> (if I use the
path to the physical file this works; but it bombs with the file data in the
var server_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">
Anyone see what I'm doing wrong here?
Thanks
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/austi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:353117
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm