CFHEADER & CFCONTENT to dowload a file
Hello everybody,
There are two buttons on my page and depending on which is clicked the code chooses to download either Report_1 or Report_2:
<cfif Form.i_hdn_rpt_1 GT 0>
<CFHEADER NAME="Content-Disposition" VALUE="inline; filename=rpt_1.csv">
<CFCONTENT TYPE="application/csv">rpt_1,1,1<cfabort>
</cfif>
<cfif Form.i_hdn_rpt_2 GT 0>
<CFHEADER NAME="Content-Disposition" VALUE="inline; filename=rpt_2.csv">
<CFCONTENT TYPE="application/csv">rpt_2,2,2<cfabort>
</cfif>
Now what's happening. Say, I click Report_2. It offers (as expected) to download the file rpt_2.csv. Then if I click Report_1 it downloads rpt_1.csv. So far so good. But after this regardless of what is clicked (Report_1 or Report_2) it downloads rpt_1.csv only.
If I begin with Report_1 then no way can I force to download rpt_2.csv.
Could anybody tell me what I am doing wrong?
Thanks,
Alex
