Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download File - Contents within a CF Page

Status
Not open for further replies.

bloise

Programmer
Jun 21, 2001
67
US
I have a CF page (Summary Page), that list links to other CF pages. The summary page list the name of the document, and has a VIEW and DOWNLOAD, hyperlink.
The view takes them to another CF page so they can modifiy the data within the document.

I am struggling with the download link. What I would like to do is have the ablity to download the CF page (view page) containing all the data and proper formatting.

Does this make any sense...

Thanks,
Mike
 
Hi,
You can force the download by using the following line

<cfheader NAME=&quot;Content-disposition&quot; VALUE=&quot;ATTACHMENT&quot;>

it will add the Content-disposition to the HTTP answer that will mention the file must be downloaded. Most of the browser support it.. maybe some old browser will not handle this property..
IE will rename the file to .html because the MIME is text/html for exemple : mypage.cfm will be downloaded as mypage.html
if you want to rename the file you can use it that way
<cfheader NAME=&quot;Content-disposition&quot; VALUE=&quot;ATTACHMENT;filename=myfile.html&quot;>
but as long as i remember Netscape does not use the filename attribute
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top