Use the Download method to transfer a file or folder from a remote location to your local hard drive.
Object.Download (BSTR strRemoteName ,BSTR strLocalName , long nMultiPartNumber)
Use this to split the download into multiple parts. The default value = 1. The value specifies the number of parts used for the download.
Set MySite = CreateObject("CuteFTPPro.TEConnection")
‘Specify user, pass, host, and connect as normal...
MySite.Connect ‘Recommended: call connect first
‘next line changes to a predetermined folder so you can use a relative path in the download method
MySite.RemoteFolder = "/c:/Inetpub/ftproot/Temp/Temp/"
MsgBox (MySite.RemoteFolder) 'display current remote folder
MySite.Download "agent.ini", "c:\temp\agent1.ini"
'now verify downloaded ok
If CBool(MySite.LocalExists ("c:\temp\agent1.ini")) Then
MsgBox "File downloaded OK."
Setting the Multi-part download attribute can greatly increase the transfer speed for larger files under certain conditions. For example, the site must support multiple concurrent connections from the same user and you must have significant bandwidth.
The Download method is a syncrhonous command, meaning it must finish executing before subsequent commands in your script can be called. Use the method DownloadAsync (which also supports Multi-part transfers) to asyncrhonously download files, which allows you to execute the rest of the script while the download(s) take place.