Single method call to send a file to the FTP server.
This method is self-contained and opens a connection, sends a file and closes the connection. You don't have to call
o.FtpSendFile(lcFTPServer, lcSource, lcTarget, lcUsername, lcPassword)
0 for success, -1 for failure
The FTP Server to send to. This is a domain name (mysite.com) or IP address (126.96.36.199). Do not specify a URL here.
The local source file to send to the server. Use a physical path or relative path.
Target file on the server either as just the file name or a server relative or current folder relative path.
Username for accessing the FTP server
Password for accessing the FTP server
loFtp = CREATEOBJECT("wwSftp") loFtp.nFtpPort = 23 lcHost = "127.0.0.1" lcUsername = "tester" lcPassword = "password" lcSourceFile = ".\tests\sailbig.jpg" lcTargetFile = "Sailbig.jpg" lnResult = loFtp.FtpSendFile(lcHost,lcSourceFile,lcTargetFile,lcUsername,lcPassword) this.AssertTrue(lnResult == 0,loFtp.cErrorMsg)
See also:Class wwSFTP
Comment or report problem with topic