Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2004, 04:41 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving web page to file

Hi does anyone know if there is a way to save a webpage

to file after the user presses a button? Any help will be

appreciated! thanks, treasa


 
Old October 21st, 2004, 05:20 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Treasa,

If you add this to your code, it should raise a file download when you click on a link to the file...
Code:
Response.AddHeader "content-disposition", "attachment; filename=myFileName.asp"
Hope this is what you're after.

Chris

 
Old October 21st, 2004, 06:22 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry to sound stupid, but where do i add this code?
thanks!

 
Old October 21st, 2004, 06:48 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just add it to the page you want the user to download, if you want a link in a page to download a copy of itself, you could create a link something like
Code:
<a href="myFileName.asp?dl=1">download this page</a>
and then at the top of the page (in asp), only write the header if the download parameter is set
Code:
If Request("dl") = "1" Then
    Response.AddHeader "content-disposition", "attachment; filename=myFileName.asp"
End If
Cheers,

Chris

 
Old October 21st, 2004, 09:59 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a million Chris, that was a great help!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a Text file from a HTML File or web page rajesh.java Java Basics 1 January 20th, 2007 08:36 AM
Saving a Web Page riggs Excel VBA 7 November 30th, 2006 04:59 AM
converting web page to pdf file swati_joshi ASP.NET 1.0 and 1.1 Professional 5 September 19th, 2006 07:58 AM
EXCEL question saving a file saving the the first macupryk VS.NET 2002/2003 0 January 6th, 2005 05:33 PM
About loading a flash file once in a web page karib Dreamweaver (all versions) 7 October 11th, 2004 01:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.