Hi everyone,
I am trying to secure non-cfm files by placing them above the wwwroot and
using CFContent, as I have seen suggested in these forums numerous times. The
problem is that I cannot get it to work. All I get are blank pages. No error
message, no file, no nothing. I tried the attached code (and other variations
on that theme). The attached code properly lists the files in the folder but
when I try to open them, I get a blank page. Any help would be much
appreciated as this is driving me crazy. I'm using CF5, by the way.
Thanks,
Vasco
<cfparam name="fname" default="">
<cfdirectory action="LIST" directory="c:\webdocs" name="dirlist">
<cfoutput query="dirlist">
<li><a href="getfile.cfm?fname=#name#">#name#</a>
</cfoutput>
<cfif fname is not "">
<cfheader name="Content-Disposition" value="attachment; filename=#fname#">
<cfcontent type="application/unknown" file = "C:\webdocs\#fname#">
</cfif>
Mr Black - 27 Dec 2005 20:17 GMT
Works perfectly here under CF5.
v_roma - 30 Dec 2005 21:29 GMT
As it should. I really don't know why this isn't working for me. I've even
tried it with different OS/browser combinations. Is there something on the
server level that could be the problem? I know CFContent is an allowed tag, so
that shouldn't be it.