'This example transfers a file from an FTP server to a local file
Sub FileReceiveExample()
On Error GoTo Handler
Dim rcode As ReturnCode
'Set the date as the current time
Dim mydate As Date
'Connect to the host server, leaving the password empty - you'll need to log on to the session before you run the macro
ThisTerminal.FileTransfer.FTPStartServer "your_user_name", "", "your_ftp_server", FTPServerOption_None
'Transfer a file on the server as an ASCII file to a local file and overwrite the file if it exists.
'Specify to transfer the file regardless of whether it was created or modifed before or after the current time
'This file name does not include wildcards so we don't need to exclude any files.
rcode = ThisTerminal.FileTransfer.FTPReceiveFile("C:\test\local_file.txt", "file_on_ftp_server", TransferTypeOption_Ascii, DestinationFileExistsOption_Overwrite, mydate, mydate, "")
'Stop the host server
ThisTerminal.FileTransfer.FTPStopServer
Exit Sub
Handler:
MsgBox Err.Description
End Sub