For information about Globalscape, visit www.globalscape.com. |
The script below connects to the GlobalSCAPE FTP site and downloads a file called index.txt to two local folders; c:/temp1 and c:/temp2.
Set MySite = CreateObject("CuteFTPPro.TEConnection")
MySite.Host = "ftp.globalscape.com"
MySite.Connect 'Recommended: call connect first
'next line changes to a predetermined folder so I can use a relative path in the download method
MySite.RemoteFolder = "/pub/cuteftp"
MySite.LocalFolder = "c:\temp1"
MsgBox (MySite.RemoteFolder) 'display current remote folder
MySite.Download "index.txt"
MySite.Download "index.txt", "c:\temp2\index.txt"
'now verify that it downloaded okay
If MySite.LocalExists ("c:\temp1\index.txt") Then
MsgBox "File1 downloaded OK."
End If
If MySite.LocalExists ("c:\temp2\index.txt") Then
MsgBox "File2 downloaded OK."
End If
MsgBox "Done"
MySite.Disconnect
MySite.Close
Connecting to a Remote Server (Connect)
Finding a Method Alphabetically