SendFile Method Example

The example transfers the file "test2.txt" from the PC and renames it "test text" on the host. Based on the return value of SendFile, 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


 Sent = Sess.SendFile("c:\test.txt","test text")

 If Sent Then MsgBox ("Sent Okay.") Else MsgBox ("Error while sending.")

End Sub