Use the TransferURLAsync method to start a download from a web address, and return control to the script immediately. This method does not wait for the transfer to end. You can use it to perform many simultaneous transfers.
The difference between this method and DownloadAsync is simply the ability to specify all of the necessary parameters in one command, rather than having to set the user name, port, host, etc. and then transfer a file.
Immediately after you call this method subsequent methods in your script will be called, so be careful when timing certain events.
If TransferURLAsync encounters a problem when trying to complete its task, it will not throw a COM, ATL, or VB error. TransferURLAsync will also adhere to your max global and per site settings. You can't use wildcards in this method.
Object.TransferURLAsync(BSTR bstrURL [, long nMultipartNumber])
bstrURL |
A string value for the URL for the file transfer (ftp://ftp.cuteftp.com/pub/cuteftp) |
nMultipartNumber |
An optional multipart parameter with default = 1 |
Set MySite = CreateObject("CuteFTPPro.TEConnection")
MySite.TransferURLAsync "ftp://ftp.cuteftp.com/pub/cuteftp/english"
‘this will transfer the entire English CuteFTP directory from the CuteFTP.com ftp site.
ftp://user:pass@ ftp.sitename.com:port
ftp://user:pass@ ftp.sitename.com
ftp://user@ ftp.sitename.com
ftp:// ftp.sitename.com:port
ftp:// ftp.sitename.com
ftp://ftp.sitename.com/pub l: user p: pass ß l: user is a lowercase "L", not "one"
ftp://ftp.sitename.com/pub:44 l: user p: pass
ftp://ftp.sitename.com/pub port:44 l: user p: pass
ftp://ftp.sitename.com/pub l/p: user/pass
ftp://ftp.sitename.com/pub:44 l/p: user/pass
ftp://ftp.sitename.com/pub p:44 l/p: user/pass
ftp://ftp.sitename.com/pub port:44 l/p: user/pass
ftp://ftp.sitename.com/pub l: user p: pass
ftp://ftp.sitename.com/pub:44 l: user p: pass
ftp://ftp.sitename.com/pub p:44 l: user p: pass
ftp://ftp.sitename.com/pub port:44 l: user p: pass
Aside from the standard URL formats shown above, additional specifiers may be used to denote the direction of transfer and download path. Use the extended format to perform site to site transfers, uploads, targeted downloads, and more.
The standard url ftp://user:pass@ftp.host.com will be used in the following examples:
Format: Normal URL transfer
Example: MySite.TransferURLAsync "ftp://user:pass@ftp.host.com"
'download site to the default download folder
Format: URL [space] "-->" [space] LPATH
Example: MySite.TransferURLAsync "ftp://user:pass@ftp.host.com --> c:\temp"
'download site to the c:\temp folder
Format: URL [space] "<--" [space] LPATH
Example: MySite.TransferURLAsync "ftp://user:pass@ftp.host.com <-- c:\web"
'upload files from c:\web to the site
Format: URL1 [space] "<->" [space] URL2
Example: MySite.TransferURLAsync "ftp://user:pass@ftp.host.com <->
ftp://user2:pass2@ftp.host2.com" 'perform a site to site transfer
Format: URL [space] "<==" [space] LPATH
Example: MySite.TransferURLAsync "ftp://user:pass@ftp.host.com <== c:\web"
'synchronize (mirror local) the c:\web folder to the site
Format: URL [space] "==>" [space] LPATH
Example: MySite.TransferURLAsync "ftp://user:pass@ftp.host.com ==> c:\web"
'synchronize (mirror remote) the site to c:\web
Format: URL [space] "<=>" [space] LPATH
Example: MySite.TransferURLAsync "ftp://user:pass@ftp.host.com <=> c:\web"
'synchronize both local and remote (mirror both)