Print Page | Close Window

saving an html page on my server in asp

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8844
Printed Date: 01 April 2026 at 1:00am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: saving an html page on my server in asp
Posted By: Nathan
Subject: saving an html page on my server in asp
Date Posted: 13 January 2004 at 5:50am

Is there anyway that I can write a script that will download an html page (not on my server), and then save it as a txt file on my server?

Thanks

Nathan

 




Replies:
Posted By: KCWebMonkey
Date Posted: 13 January 2004 at 8:55am

You can use FSO (FileSystemObject) to save text files. http://www.w3schools.com/asp/asp_ref_file.asp - http://www.w3schools.com/asp/asp_ref_file.asp

and...

How are you planning on getting the url for the remote html page?



Posted By: Mart
Date Posted: 13 January 2004 at 11:18am
You can use Microsoft XML HTTP (think its that) to download the file, do a search on the forum in the asp discussion. If you have no luck i've got an example somewhere.


Posted By: Nathan
Date Posted: 20 January 2004 at 6:57am

Sorry I was not very clear with what I am trying to do. The chat system I use is a JavaHosted one. I want to be able to show on each page of my site, who is currently chatting. By following this link, I can view who is chatting - (but of course this file is not on my server):

http://client1.sigmachat.com/scwho.pl?id=52241 - http://client1.sigmachat.com/scwho.pl?id=52241

I want to be able to save the results of the above link as a simple txt file for inclusion on each of my web site pages. The script would be executed everytime someone joins (or leaves) the chat room to update the txt file.

Any help would be very welcome.

Thanks

Nathan



Posted By: fernan82
Date Posted: 20 January 2004 at 2:18pm
You can use Microsoft's XMLHTTP component as mart suggested, here's some code:

<%
Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", " http://client1.sigmachat.com/scwho.pl?id=52241 - http://client1.sigmachat.com/scwho.pl?id=52241 ", False
objXML.Send
%>
<html>
<head></head>
<body>
<table><tr><td><% = objXML.ResponseText %></td></tr></table>
</body>
</html>
<% Set objXML = Nothing %>

You should place the <% = objXML.ResponseText %> wherever you want that page to be shown on your site.

The right way would be to parse the HTML from that page and get just
the usernames.... Or at least strip off everything exept the body of the page.





-------------
FeRnAN
http://www.danasoft.com/">


Posted By: Bluefrog
Date Posted: 21 January 2004 at 9:12am
There are other components to do the same thing as XMLHTTP. I suppose it depends on whether you need more functionality. Doesn't look like you do though.

-------------
http://renegademinds.com/" rel="nofollow - Renegade Minds - Guitar Software http://renegademinds.com/Default.aspx?tabid=65" rel="nofollow - Slow Down Music


Posted By: Nathan
Date Posted: 08 February 2004 at 1:07pm

Super! Thanks People - it works great - the beers are on me!

Have been fiddling with XML over the last few days. A little worrying really, some of the things you can do should be illegal!

How demanding is XML on the server though? I worry that this may put extra load - defeating the orignal reason for using it.

Nathan

Thanks to Sofri from the Agni Travel office for his help in debuggin my scripts.

http://www.agni.gr - www.agni.gr

 

 

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net