GetFTPFile Method

Retrieves a file from an FTP server and saves it to the local hard disk.


obj.GetFTPFile(Host String, RemoteFile String, DestinationLocalFile String, [AsciiText Boolean], [PortNumber Long], [LogonUserID String], [LogonPassword String], [AccessType Long])
Where obj is an OpScrUtil.INet object.


Host The name of the FTP server, for example
RemoteFile The path and name of the file to be retrieved from the FTP server.
DestinationLocalFile The full path of the local file where the retrieved FTP file will be saved.
AsciiText (True/False) Determines if the file should be transferred in ASCII or binary mode. This parameter is optional. The default value is False.
PortNumber Allows specification of a port number other than the default FTP protocol port (21). This parameter is optional.
LogonUserID User ID used while logging onto FTP server. This parameter is optional. Leave blank to specify anonymous logon.
LogonPassword Password used while logging onto FTP server. This parameter is optional.
Access Type Flags specify options for Internet connection. This parameter is optional. This can be one of the following values:
Retrieves the proxy or direct configuration from the registry.
Resolves all host names locally.
Passes requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy. In this case, the function uses INTERNET_OPEN_TYPE_DIRECT.
Retrieves the proxy or direct configuration from the registry and prevents the use of a startup JScript® (compatible with ECMA 262 language specification) or Internet Setup (INS) file.

Return Type



To retrieve the latest_update.exe file from the ftp site using the george user ID and the BlueSky password, enter:

Set obj = CreateObject("OpScrUtil.INet")
bOK = obj.GetFTPFile("", "/Support/Downloads/latest_update.exe", False, , "george", "BlueSky")
If Not bOK Then
strError = obj.GetError()
End If

This example shows how to retrieve an FTP file from a remote server.