|
|
|
|
|
SCPGetFile (Function) In french: SCPRécupèreFichier Gets a file 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 = fRepExe() + [fSep()] + sNomFichier
sCheminFichierDistant is string = "~/compta/" + sNomFichier
IF NOT SCPGetFile(sessionSSH, sCheminFichierDistant, ...
sCheminFichierLocal, Progression) THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info("Récupération terminée")
END
INTERNAL PROCEDURE Progression(nTailleTotale, nTailleEnCours)
Trace(nTailleEnCours + "/" + nTailleTotale)
END
Syntax
<Result> = SCPGetFile(<SSH connection> , <Remote file> , <Local file> [, <WLanguage procedure>])
<Result>: Boolean - True if the file has been retrieved,
- False otherwise. Use ErrorInfo to get the details of the error.
<SSH connection>: sshSession variable Name of the sshSession variable used to get the file. <Remote file>: Character string Name and full (or relative) path of the file on the remote host. <Local file>: Character string Name and full (or relative) path of the file to be retrieved on the local host using the Secure Copy Protocol. <WLanguage procedure>: Optional procedure name Name of the WLanguage procedure ("callback") called when getting the file. This procedure gets the progress of the file transfer. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|