|
|
|
|
WLanguage procedure called by SCPSendFile WLanguage procedure ("callback") called by SCPSendFile when transferring files to a remote host using the Secure Copy Protocol (SCP). This procedure gets the progress of the file transfer to the remote host. // Set up SSH session SSHSession is sshSession SSHSession.Address = "myserver.com" SSHSession.Port = 22 SSHSession.User = "username" SSHSession.UserPassword = "password" SSHSession.ConnectionTimeout = 2s  sFileName is string = "accounting_january.docx" // File path on the local host sLocalFilePath is string = fExeDir() + [fSep()] + sFileName // File path on the remote host (Linux in this case) sRemoteFilePath is string = "~/accounting/" + sFileName  // Transfer the file using SCP IF NOT SCPSendFile(SSHSession, sLocalFilePath, ... sRemoteFilePath, Progress) THEN Error(ErrorInfo(errFullDetails)) ELSE Info("File transfer completed") END   // Progress monitoring (optional procedure) INTERNAL PROCEDURE Progress(nTotalSize, nCurrentSize) Trace(nCurrentSize + "/" + nTotalSize) END Syntax
SCPSendFile_Callback(<Total size> , <Size sent>)
<Total size>: Integer Total size (in bytes) of the file to send. <Size sent>: Integer Bytes sent.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|