Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Downloading file not the correct contents

Explorer ,
May 06, 2013 May 06, 2013

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

340
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 06, 2013 May 06, 2013
LATEST

I am trying to download a text file, not a cfm file.

Mike

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources