|
|
|
|
WLanguage procedure called by SCPGetFile WLanguage procedure ("callback") called by SCPGetFile when retrieving a file on a local computer using the Secure Copy Protocol (SCP). This procedure gets the file transfer progress status on the local computer. // Set up SSH session SSHSession is sshSession SSHSession.Address = "myserver.com" SSHSession.Port = 22 SSHSession.User = "username" SSHSession.UserPassword = "password" SSHSession.ConnectionTimeout = 2 s  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  // Get the file using SCP IF NOT SCPGetFile(SSHSession, sRemoteFilePath, ... sLocalFilePath, Progress) THEN Error(ErrorInfo(errFullDetails)) ELSE Info("File successfully retrieved") END   // Progress monitoring (optional procedure) INTERNAL PROCÉDURE Progress(nTotalSize, nCurrentSize) Trace(nCurrentSize + "/" + nTotalSize) END
Syntax
SCPGetFile_Callback(<Total size> , <Size sent>)
<Total size>: Integer Total size (in bytes) of the file to get. <Size sent>: Integer Size (in bytes) of the file that has already been retrieved.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|