1 Reply Latest reply on May 6, 2013 7:36 AM by userCold9

    Downloading file not the correct contents

    userCold9 Level 1

      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