Hi all,

I'm having a problem with the CFHeader tag and the CFContent tag combination
and hoped someone had a way around it.

I am trying to force browsers to download a file rather than launching it in
their plugins while also masking the actual location of the file.

Thanks to Shawn, I've gotten far enough that the functionality is correct,
but I'm running into an annoying display issue.

My code is below. This is what happens:

To force the browser to save rather than opening the file in the browsers,
you have to use the attachment value in the CFHeader (as far as I can tell.)

When you use the attachment value, two things go wrong:

1) The filename displayed in the File Download dialog is actually the full
URL with query string that you call to launch files this way, (i.e.
getfile.cfm?file=george.txt&type=peter&comment=what is the meaning of 42),
of course only actually the last 20-40 characters display.

2) If you select Open file from this location, on one of my test systems, it
actually opens the File Download dialog again. (This may be a fluke since
its not on the other system.

<CFSET actualname="#URLDecode(URL.file)#">
<CFHEADER NAME="Content-Disposition" VALUE="attachment;
filename=#actualname#">
<cfcontent type="nothing/unknown"
file="#filepath#" deletefile="No">

I'd appreciate any suggestions or even just the answer that I have to live
with it. I've tried a bunch of stuff, but the only way to get the filename
back into the display is to take out attachment from the CFHEADER value and
that will not work.

Thanks in advance,
Margaret
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to