473,657 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I copy an html file to a local drive ?

How can I copy an html file to a local drive ?
For example: I would like to copy
www.mywebsite.mypage.htm to
c:\inetput\wwwr oot\mydir\mypag e.htm, can I do that ?

Thanks.
Jul 22 '05 #1
1 1697
"paul fpvt2" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
How can I copy an html file to a local drive ?
For example: I would like to copy
www.mywebsite.mypage.htm to
c:\inetput\wwwr oot\mydir\mypag e.htm, can I do that ?

Thanks.


Try this.

Option Explicit
'*
Const cURL = "www.mywebsite. mypage.htm"
Const cOUT = "c:\inetput\www root\mydir\mypa ge.htm"
'*
WScript.Echo "Success? " & Fetch(cURL,cOUT )

Function Fetch(xURL,xOUT )
On Error Resume Next
Fetch = False
Err.Clear
Dim objXML
Set objXML = CreateObject("M icrosoft.XMLHTT P")
objXML.Open "GET",xURL,Fals e
objXML.Send
Dim strXML
strXML = objXML.Response Body
If Err.Number <> 0 _
Or objXML.Status <> 200 Then
Exit Function
End If
Set objXML = Nothing
Dim objADO
Set objADO = CreateObject("A DODB.Stream")
objADO.Type = 1
objADO.Open
objADO.Write strXML
objADO.SaveToFi le xOUT,2
Set objADO = Nothing
Fetch = Err.Number = 0
End Function

It will work with binary files (e.g. images) as well.
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4247
by: Somedude | last post by:
Hello, I am building a small page to copy files from our server(s) to our users local machines. It's very simple... (below, "f" is a mapped network drive) <?php $source_file = 'f:\somefile.whatever'; $destination_path = (I want to move it to the USERS
9
8138
by: Josh Mayfield | last post by:
Note: There is considerable background detail here, but I do have three questions, which are clearly marked and appear right before the sample code. I have a legitimate need to launch an EXE from an HTML page on Windows XP/Internet Explorer. The EXE is already locally installed, and the HTML page is also viewed locally on the PC- it's not a web site. I know of two ways to do this, both of which are featured in the sample HTML file at...
3
5202
by: Nathaniel Wingard | last post by:
I recently was asked to write a program that moved files to certain places on a network drive based on what the files were (mainly filenames since the files are mostly Office documents of various types). I have tried rename() but it seems to have problems with moving things across file systems, and I have had problems with system("cmd.exe /c move file1.doc file2.doc") and various like comands with it not moving all the files all the time...
11
8237
by: Mike | last post by:
I want to be able to copy a directory of files (all .HTM files) from a network drive to a local drive on the machine c:\HTMFiles , How can i do that? I tried File.Copy(source, dest) but i need to put the file name in the dest section. I just want to copy the entire directory since I don't know all the file names just the extensions. Would File.Copy("\servername\folder", "c:\\HTMFiles\*.HTM") work or no? thx
4
2638
by: Brian Hanson | last post by:
Hi, I have a problem that is sporadic and am thinking it may come down to a timing issue. I have an asp.net (vb) app that used the system.io.file.copy method to copy a .pdf file from a network drive to the local server drive. From there I use that .pdf file to create another .pdf file using a tool from ActivePDF. The problem I have is that one out of 8 or 10 times I get an error: Access to the path "c:\ActivePDF\watever.pdf" is...
4
11728
by: sajid_yusuf | last post by:
Hi I am trying to develop a Windows service in VB.NET which has timer enabled and keeps checking a folder (or group of folders) for any new file or changed files. As soon as it detects any new file or changes (to files or folders) then it copies the files (and any new folders) to a folder in the mapped network drive. So far I have been successful in developing and deploying the service which works on my local machine with two drives...
2
4796
by: Cliff72 | last post by:
Is there a way in VBA to copy a file from a web server to a local drive? Example: Every morning at 3AM a huge mainframe report is run and a copy of this report is saved as a text file on a web server: http://GLJobs.CliffKing.com/Reports_txt/MyReport101007.txt The name of my report is: MyReport101007.txt I manually download this report to the C:\ drive and then manually import it into access.
1
3881
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to a single folder called 'All Files' Do we spread them out and copy them to multiple folders like Folder 000 - Copy files from 0 to 1000 Folder 001 - Copy files from 1000 to 2000 Folder 002 - Copy files from 2000 to 2999
1
2282
by: thanawala27 | last post by:
Hi, I have mapped a server to my computer (called it H drive). all my perl scripts run on the server. Now, i would like to copy a file from my local hard disk (C drive) to this server. As my scripts are running on the server, so while copying the file, the server is not able to recognize the location of the C drive (which is my local computer) So, how do I make the server recognize my local computer and hence copy the file to the...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.