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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

downloading a page instead of opening

Status
Not open for further replies.

dionisox

Technical User
May 3, 2002
10
IT
Is it possible to force the download of a HTML file (download window) clicking on a link instead of opening the file in the browser window?
Thanks
 
<%
Dim Stream
Dim Contents
Dim FileName
FileName = &quot;file_name.html&quot;
Response.ContentType = &quot;application/octet-stream&quot;
Response.AddHeader &quot;content-disposition&quot;, &quot;attachment; filename=&quot; & FileName
Set Stream = server.CreateObject(&quot;ADODB.Stream&quot;)
Stream.Open
Stream.LoadFromFile Server.MapPath(FileName)
Contents = Stream.ReadText
Response.BinaryWrite Contents
Stream.Close
Set Stream = Nothing
%>
www.vzio.com
star.gif
if I helped. [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top