Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

Downloading file not the correct contents

$
0
0

Hi,

 

I have a link on another page the take me over to the page that contains the code below:

 

 

<CFOUTPUT>
<CFSET FPATH = #GetDirectoryFromPath(ExpandPath("*.*"))#>

<cfdirectory directory="#FPATH#" name="FILES" action="LIST">

<TABLE>
<CFLOOP Query="FILES">
<TR><TD>
<CFIF #FILES.NAME# EQ "test.cfm">

 
<A href="#FILES.NAME#"> #FILES.NAME# 

<cfheader name="Content-Disposition" value="attachment;filename=#FILES.NAME#">


</A>
</CFIF>
</TD>
</TR>
</CFLOOP>
</TABLE>
</CFOUTPUT>

 

When I select the test.cfm link, a dialog box appears asking to either Save or Open the file.

 

The issue is the file, test.cfm, contents is not what is being saved or displayed when Open is selected.

 

Is there something I'm missing?

 

 

Thanks,

 

 

Mike


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>