|
|
|
|
|
SCPSendFile (Function) In french: SCPEnvoieFichier Transfers files via the Secure Copy Protocol. Reminder: Secure Copy Protocol (SCP) is a protocol for secure data transfer between a local and a remote computer, or between two remote computers.. This protocol is based on an SSH connection.
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"
sLocalFilePath is string = fExeDir() + [fSep()] + sFileName
sRemoteFilePath is string = "~/accounting/" + sFileName
IF NOT SCPSendFile(SSHSession, sLocalFilePath, ...
sRemoteFilePath, Progress) THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info("File transfer completed")
END
INTERNAL PROCEDURE Progress(nTotalSize, nCurrentSize)
Trace(nCurrentSize + "/" + nTotalSize)
END
Syntax
<Result> = SCPSendFile(<SSH connection> , <Local file> , <Remote file> [, <WLanguage procedure>])
<Result>: Boolean - True if the data was sent,
- False otherwise. Use ErrorInfo to get the details of the error.
<SSH connection>: sshSession variable Name of the sshSession variable used to send the file. <Local file>: Character string Name and full (or relative) path of the file to be transferred via the Secure Copy Protocol. <Remote file>: Character string Name and full (or relative) path of the destination file on the remote host. <WLanguage procedure>: Optional procedure name Name of the WLanguage procedure ("callback") called when sending the file. This procedure gets the progress of the file transfer.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|