Problems with Filesystem object Copy method 
Author Message
 Problems with Filesystem object Copy method

FSO methods do not support HTTP...

If it's an Intranet, you could use a UNC path to the file on the server, assuming there was an
appropriate network share established...

--
Michael Harris
MVP Scripting

Hi all. I have the following:
.
set fs = CreateObject("Scripting.FileSystemObject")
set theFile = fs.GetFile(" http://www.*-*-*.com/ ;)
theFile.copy ("C\/Program Files\whatever\")
.
I have Personal Web Server running, and my computer is 'jere.computer.net'.
'test' is a folder which has been set for web sharing. Web pages in this
folder can be accessed through the URL http://www.*-*-*.com/
whatever.exe is also in this folder. (The above code is in a web page).
However when this code runs, it gets to the line:
.
set theFile = fs.GetFile(...
.
and gives the following error: "Error: File Not Found..."
.
Is it possible to use the Filesystem object in this way? If not then how
would you go about downloading a file from a website and storing it to the
users hard drive? (With their permission, of course - I'm not writing a
virus... ;-)
.
Thanks muchly for any help,
Jere



Mon, 02 Dec 2002 03:00:00 GMT  
 Problems with Filesystem object Copy method
Hi all. I have the following:
.
set fs = CreateObject("Scripting.FileSystemObject")
set theFile = fs.GetFile("http://jere.computer.net/test/whatever.exe")
theFile.copy ("C\/Program Files\whatever\")
.
I have Personal Web Server running, and my computer is 'jere.computer.net'.
'test' is a folder which has been set for web sharing. Web pages in this
folder can be accessed through the URL http://jere.computer.net/test/ and
whatever.exe is also in this folder. (The above code is in a web page).
However when this code runs, it gets to the line:
.
set theFile = fs.GetFile(...
.
and gives the following error: "Error: File Not Found..."
.
Is it possible to use the Filesystem object in this way? If not then how
would you go about downloading a file from a website and storing it to the
users hard drive? (With their permission, of course - I'm not writing a
virus... ;-)
.
Thanks muchly for any help,
Jere


Tue, 03 Dec 2002 03:00:00 GMT  
 Problems with Filesystem object Copy method
Attached WSC Component For HTTP.

Right-click, Choose Register

Then:
->
Dim Hp
Set Hp = CreateObject("http.wsc")
 Hp.Get "url", "local_path"
Set Hp = Nothing
<-

Needs IE5 on the computer.

Dominic



Tue, 03 Dec 2002 03:00:00 GMT  
 Problems with Filesystem object Copy method
Unfortunately I really need this to work in IE4 , but thanks for your
suggestions anyway.
.
Cheers, Jere
.
Quote:

>Attached WSC Component For HTTP.

>Right-click, Choose Register

>Then:
>->
>Dim Hp
>Set Hp = CreateObject("http.wsc")
> Hp.Get "url", "local_path"
>Set Hp = Nothing
><-

>Needs IE5 on the computer.

>Dominic



Thu, 05 Dec 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. problems with copy method of file object

2. GetFolder method for FileSystem Object not working on Win2000

3. Problem with filesystem object

4. filesystem object problems (again)

5. filesystem object problems

6. Problems with FileSystem Object

7. Problem FileSystem object in JScript

8. FileSystem object problem...

9. Problem with FileSystem Object

10. Find a copy a file with File.Copy method

11. Need help with FileSystem Copy Please!

12. Organizer Copy Method Problem

 

 
Powered by phpBB® Forum Software