ReceiveFile Method Example

The example transfers the file "test text" from the host and renames it "test2.txt" on the PC. Based on the return value of ReceiveFile, the message box indicates success or failure of the transfer.

Sub Main()

 Dim Sys As Object, Sess As Object

 

 Set Sys = CreateObject("EXTRA.System")

' Assumes an open session

 Set Sess = Sys.ActiveSession

 

 Sess.FileTransferScheme = "Text Default"

 Sess.FileTransferHostOS = 0 '0 = CMS

 

 Recv = Sess.ReceiveFile("c:\test2.txt","test text")

 If Recv Then MsgBox ("Okay") Else MsgBox ("Error")

End Sub