High level function to download a file from the SFTP server.
This method is self-contained and opens a connection, receives a file and closes the connection. You don't have to call
o.FtpGetFile(lcFTPServer, lcFtpSource, lcLocalTarget, lnBinary, lcUsername, lcPassword)
0 for success, -1 for failure.
IP Address or domain name of the server
The Ftp file on the server to download. Specify a filename in the current path or relative paths.
- sailbig.jpg (current folder)
- subfolder/sailbig.jpg (subfolder below current folder)
- /subfolder/sailbig.jpg (subfolder below root folder)
The local source file to download to. Either a physical or relative path.
ignored - pass in 0
Username for the accessing the server
Password for accessing the server
loFtp = CREATEOBJECT("wwSftp") loFtp.nFtpPort = 23 lcHost = "127.0.0.1" lnPort = 23 lcUsername = "tester" lcPassword = "password" lnResult = loFtp.FtpGetFile(lcHost,"sailbig.jpg",".\tests\sailbig.jpg",1,lcUsername,lcPassword) IF (lnResult != 0) ? loFtp.cErrorMsg ENDIF
See also:Class wwSFTP
Comment or report problem with topic