ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / SCP functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
Example
// Création de la session SSH
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"
//chemin du fichier sur le poste local
sCheminFichierLocal is string = fRepExe() + [fSep()] + sNomFichier
//chemin du fichier sur le poste distant (ici sous Linux)
sCheminFichierDistant is string = "~/compta/" + sNomFichier

//récupération du fichier via SCP
IF NOT SCPGetFile(sessionSSH, sCheminFichierDistant, ...
		sCheminFichierLocal, Progression) THEN
	Error(ErrorInfo(errFullDetails))
ELSE
	Info("Récupération terminée")
END


// Suivi de la progression (procédure optionnelle)
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.
For more details on this procedure, see Parameters of the procedure used by SCPGetFile.
Business / UI classification: Business Logic
Component: wd300com.dll
Minimum version required
  • Version 28
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help