ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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
WLanguage procedure called by SCPSendFile
WLanguage procedure ("callback") called by SCPSendFile when transferring files to a remote host using the Secure Copy Protocol (SCP). This procedure gets the progress of the file transfer to the remote host.
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 = fExeDir() + [fSep()] + sNomFichier
// Chemin du fichier sur le poste distant (ici sous Linux)
sCheminFichierDistant is string = "~/compta/" + sNomFichier

// Envoi du fichier via SCP
IF NOT SCPSendFile(sessionSSH, sCheminFichierLocal, ...
			sCheminFichierDistant, Progression) THEN
	Error(ErrorInfo(errFullDetails))
ELSE
	Info("Envoie terminé")
END


// Suivi de la progression (procédure optionnelle)
INTERNAL PROCEDURE Progression(nTailleTotale, nTailleEnCours)
	Trace(nTailleEnCours + "/" + nTailleTotale)
END
Syntax
SCPSendFile_Callback(<Total size> , <Size sent>)
<Total size>: Integer
Total size (in bytes) of the file to send.
<Size sent>: Integer
Bytes sent.
Minimum version required
  • Version 28
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/20/2025

Send a report | Local help