wwSFTP::FtpGetFileEx

Downloads a file from the Ftp server to a local folder. Make sure to call FtpConnect() before calling this method.

o.FtpGetFileEx(lcFtpSourceFile, lcLocalTargetFile)

Return Value

0 on success, -1 for error.

Parameters

lcFtpSourceFile
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)

lcLocalTargetFile
The local file name where the file should be downloaded to.

Example

loFtp = CREATEOBJECT("wwSftp")

loFtp.cFtpServer =  "127.0.0.1"
loFtp.nFtpPort = 23
loFtp.cUsername = "tester"
loFtp.cPassword = "password"

loFtp.FtpConnect()

loFtp.FtpGetFileEx("sailbig.jpg","c:\temp\sailbig.jpg")
loFtp.FtpGetFileEx("subfolder2/sailbig2.jpg","c:\temp\sailbig2.jpg")
loFtp.FtpGetFileEx("/subfolder3/sailbig3.jpg","c:\temp\sailbig3.jpg")

loFtp.FtpClose()

See also:

Class wwSFTP

© West Wind Technologies, 2023 • Updated: 12/09/20
Comment or report problem with topic