INET::SFTP Class
Description
Class for uploading data using SFTP (FTP over SSH). For FTP or FTPS(FTP over SSL) use INET::FTP
Example
' Example SFTP session in the Interactive Window dim sftp as inet::sftp sftp.ServerHost = "ftp.myserver.com" sftp.SecurityMethod = inet::SSHSecurityMethod::Password sftp.UserName = "<user> " sftp.Password = "<pwd>" ' Listing dim Listing as C ?sftp.ListDirectory(Listing,"/downloads") = .T. ?listing ?sftp.SendFile("c:\temp\SFTPTest.txt", "/downloads/SFTPTest.txt") = .T. ?sftp.ReceiveFile("/downloads/SFTPTest.txt", "c:\temp\SFTPTest.txt") = .T. ?sftp.DeleteFile("/downloads/SFTPTest.txt") = .T.
Properties
- CallResultCallResult
The result of the last call to a method on the SFTP class.
- ServerHostCharacter
Default = "localhost". The location of the SFTP server.
- ServerPortNumeric
Default = 22. The port over which to establish the secure connection.
- ServerConnectTimeoutInMillisecondsNumeric
Default = -1 (wait until Windows fails the socket open). The number of milliseconds to wait for a new connection before giving up.
- SecurityMethodINET::SSHSecurityMethod
Default = INET::SSHSecurityMethod::Password. The security method to use when connecting to the server (Password, KeyInMemory, KeyInFile).
- UserNameCharacter
The user name to use when the security method selected is INET::SSHSecurityMethod::Password.
- PasswordCharacter
The password name to use when the security method selected is INET::SSHSecurityMethod::Password. Be sure to protect the password and to set it from code rather than embedding it as a constant.
- PublicKeyCharacter
When INET::SSHSecurityMethod is set to INET::SSHSecurityMethod::KeyInMemory this value is to be set to the Base64 value of the public key. When INET::SSHSecurityMethod is set to INET::SSHSecurityMethod::KeyInFile, this value is to be set to the full path of a file containing the public key.
- PrivateKeyCharacter
When INET::SSHSecurityMethod is set to INET::SSHSecurityMethod::KeyInMemory this value is to be set to the Base64 value of the private key. When INET::SSHSecurityMethod is set to INET::SSHSecurityMethod::KeyInFile, this value is to be set to the full path of a file containing the private key.
- PrivateKeyPasswordCharacter
When INET::SSHSecurityMethod is set to INET::SSHSecurityMethod::KeyInMemory, or INET::SSHSecurityMethod::KeyInFile this value is to be set to the password (if any) assigned to the private key.
- EnableTraceLogical
Default = .t.. If set to .t., enables tracing for the SFTP object.
- BufferSizeNumeric
Default = 32768. The buffer size to use in transferring files. Performance can be improved on large file transfers by increasing the size of this buffer. Setting the property is optional.
Methods
- DeleteFile Method
Delete a file from an FTP server using SSH over FTP.
- ListDirectory Method
List the contents of a server directory.
- ReceiveFile Method
Receives a file from the server. Contents are transferred as binary.
- SendFile Method
Send a file to the server. Contents are sent as binary.
See Also