Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 21st, 2004, 04:41 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
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


Reply With Quote
  #2 (permalink)  
Old October 21st, 2004, 05:20 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
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

Reply With Quote
  #3 (permalink)  
Old October 21st, 2004, 06:22 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old October 21st, 2004, 06:48 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
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

Reply With Quote
  #5 (permalink)  
Old October 21st, 2004, 09:59 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks a million Chris, that was a great help!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:52 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.