|
|
|
|
|
<sshSession variable>.SCPSendFile (Function) In french: <Variable sshSession>.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.
sessionSSH is sshSession
sessionSSH.Address = "monserveur.com"
sessionSSH.Port = 22
sessionSSH.User = "username"
sessionSSH.UserPassword = "password"
sessionSSH.ConnectionTimeout = 2 s
sNomFichier is string = "compta_janvier.docx"
sCheminFichierLocal is string = fExeDir() + [fSep()] + sNomFichier
sCheminFichierDistant is string = "~/compta/" + sNomFichier
IF NOT sessionSSH.SCPEnvoieFichier(sCheminFichierLocal, ...
sCheminFichierDistant, Progression) THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info("Envoie terminé")
END
INTERNAL PROCEDURE Progression(nTailleTotale, nTailleEnCours)
Trace(nTailleEnCours + "/" + nTailleTotale)
END
Syntax
<Result> = <SSH connection>.SCPSendFile(<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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|