wwSFTP::FtpSendFileEx

Sends a file to the server on an already open connection. Make sure you have called FtpOpenConnection() before calling this method.

o.FtpSendFileEx(lcLocalSourceFile, lcFtpTargetFile)

Return Value

0 for success, -1 for failure

Parameters

lcLocalSourceFile
The local file to send to the server.

lcFtpTargetFile
The remote file name to send the file to. Path has to be a server root based (ie. /root/subfolder/file.txt) rather than a current directory based path.

Example

loFtp = CREATEOBJECT("wwSftp")

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

lcSourceFile = ".\tests\sailbig.jpg"
lcTargetFile = "/SubFolder/Sailbig.jpg"
lcTargetFile = STRTRAN(lcTargetFile,".jpg","_" + TRANSFORM(SECONDS())+ ".jpg")

loFtp.FtpConnect()

lnResult = loFtp.FtpSendFileEx(lcSourceFile,lcTargetFile)

loFtp.FtpClose()

See also:

Class wwSFTP (deprecated)

© West Wind Technologies, 2024 • Updated: 08/09/17
Comment or report problem with topic