NET SFTP Library
SFTP Class Members
Properties  Methods  Events


KellermanSoftware.NetSFtpLibrary Namespace : SFTP Class

The following tables list the members exposed by SFTP.

Public Constructors
 NameDescription
Public ConstructorOverloaded.   
Top
Public Properties
 NameDescription
Public Property If true there is an Asynchronous tranfer in progress  
Public Property Set the Buffer Size In Bytes For Uploading and Downloading. The default is 32767 bytes  
Public Property The number of bytes that were skipped during a Syncronize Upload or Download because the files were the same  
Public Property Compression. The default is autodetect. If the server supports ZLib compression it will atomatically be used.  
Public PropertySpecifies the current FTP directory.  
Public Property The name of the current directory being transferred (the source directory name). This property is filled durring asynchronous uploads/downloads for directories. For single file operations, this property is string.empty.  
Public Property When uploading/downloading directories this is the number of the current directory or subdirectory being transferred.  
Public Property The name of the current file being transferred. This property is filled during asynchronous uploads/downloads.  
Public Property The currently transferring file destination. This property is filled during asynchronous uploads/downloads.  
Public Property When uploading/downloading directories this is the number of the current file being transferred.  
Public Property Attach a custom logger for logging  
Public Property This is a property that is set after connecting to the default directory. When disconnected, this property is null.  
Public Property When uploading/downloading directories, this is the total number of directories and sub directories to be transferred.  
Public Property If true when uploading a file do not check if the target directory is the same name as the file being uploaded  
Public Property During a file/directory transfer operation, this is the time that remains. This is calculated by the average KB/Second and the remaining bytes to transfer.  
Public Property Some FTP servers do not allow root access. Kellerman FTP automatically detects this but it can be overridden. Example: _sftp.Connect(); _sftp.CurrentDirectory="MyDirectory"; _sftp.ExactDirectoryMode=false;  
Public Property When uploading/downloading directories this is the total number of files to be transferred.  
Public Property FIPS 140-2 Mode. If true, only AES and 3DES algorithms will be allowed for communication. Only HMAC SHA1 will be used for the handshake. The default is false. Your remote SSH Server must support FIPS 140-2 in order to connect.  
Public PropertySpecifies the host name or IP Address of the FTP Server.  
Public Property The difference in hours between the local time and the FTP Server Time. See the CalcHourDifference to automatically calculate the hour difference between the local PC and the FTP Server.  
Public Property By default, local directories that do not have permission to be read will throw an unauthorized exception. Setting this flag ignores those errors.  
Public PropertyReturns true when any FTP operation is in progress.  
Public Property If true, the SFTP operation has been cancelled  
Public PropertyReturns true if we are connected to the FTP server.  
Public Property During a file or directory transfer operation, this is the average transfer rate in KB/Sec.  
Public Property During a file or directory transfer operation, this is the highest transfer rate in KB/Sec.  
Public PropertyThis is the current speed of a file or directory transfer in KB/Sec.  
Public Property This is the maximum number of KB/Sec of bandwidth that the FTP component will use If zero, it will transfer at top speed.  
Public Property When synchronizing, or when not overwriting files, this is the current number of bytes that didn't need to be transferred.  
Public Property Get the last exception that occurred during an FTP Operation. This value is automatically set to null each time a new FTP Session is Connected. The default for this property is null.  
Public PropertyReturn the last FTP Command Attempted.  
Public PropertyReturn the last FTP Response from the server.  
Public Property If true, the user name and password will be replaced with **** when logging, otherwise they will be displayed. The default is true.  
Public Property When trying to connect the .NET SFTP Library will try User Name and Password, Public Key Authentication, and Keyboard Interactive Authentication By Default. There are a default of three authorization attempts. If set to 1, it will only try User Name and Password, if set to 2 then User Name/Password then Public Key, if 3 then Keyboard Interactive Authentication  
Public Property Explicitly override the ciphers that should be used when connecting. This is a comma delimited list. Valid Ciphers are: aes128-ctr,aes128-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc,3des-ctr,3des-cbc,blowfish-cbc,arcfour256,arcfour128,arcfour  
Public Property Explicity override the MAC integrity checking when connecting. This is a comma delimited list. Valid MAC algorithims are: hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96  
Public Property If a file already exists locally it will be overwritten during a download. The default for this property is false.  
Public Property If a local file is a read only file it will be overwritten durring a download. The default for this property is false.  
Public Property Returns the parent directory for the current directory or the root  
Public PropertySpecifies the password to use while communicating with the FTP Server.  
Public Property The percent complete for the overall transfer  
Public PropertySpecifies the port to communicate with the FTP Server. The default is 21.  
Public Property Hold Information about the FTP Proxy Server. Socks 5 is normally used for proxy servers with port 1080. The older Socks 4 is supported, this also normally operates on port 1080.  
Public Property Gets/Sets the timeout in milliseconds when reading/writing to a local file stream or network stream. The default is to wait 30000 (30 seconds).  
Public Property By default the .NET FTP Library assumes your FTP Server supports the REST command when connections are lost. If set to false, the entire file is re-transfered when the connection is lost  
Public Property Retry timeout in milliseconds if a network connection drops. The default is to wait 5 minutes if the network drops and then retry an upload or download from the last byte position. If no retry is desired set to -1.  
Public Property Uniquely identifies this instantiated FTP object  
Public Property When synchronizing, or when not overwriting files, this is the current number of files that didn't need to be transferred.  
Public Property A private key file for an SSH connection in OpenSSH or Putty format  
Public Property As an alternate to the SSH Key File, create a memory stream for the key  
Public Property A passphrase for the SshKeyFile or SshKeyStream if required  
Public Property Determines which files are transferred during synchronization. Default is CopyIfTheSizeIsDifferentOrDateIsNewer  
Public Property During a file/directory transfer operation, this is the time that has elapsed.  
Public Property Gets/Sets the number of milliseconds to wait for a request from the FTP server. The default is to wait 30000 (30 seconds).  
Public Property Return a list of all the time zones and their GMT offset. This can be used to populate a drop down list similar to the Date Property Dialog in Windows XP or Windows Vista.  
Public Property Determines if files are transferred as binary or ASCII. The default is binary. See the TransferMode enum for more information.  
Public PropertySpecifies the user name to use while communicating with the FTP Server.  
Top
Public Methods
 NameDescription
Public MethodCalculate the difference in hours between the local pc and the remote ftp server. The current logged in user must have write access to the current ftp directory.  
Public MethodCancels any async transfers  
Public MethodOverloaded.  Clear the file log  
Public MethodCompress the passed bytes using the specified compression type  
Public MethodCompress a file using the specified compression type  
Public MethodCompress a stream using the specified compression type  
Public MethodOpen the FTP Server connection explicitly and leave it open until explicitly closed.  
Public MethodReturn true if the Cyclic Redundancy Check is the same for two local files. This is a fast way to compare if two files are the same  
Public Method Create a directory in the current FTP directory  
Public Method Creates a local-side port forwarding.  
Public Method Creates a remote side port forwarding to a host at the local side.  
Public MethodDecompress the passed bytes using the specified compression type  
Public MethodDecompress a file using the specified compression type  
Public MethodDecompress a stream using the specified compression type  
Public MethodDelete all files in the current FTP directory with a modification date within the specified date range  
Public MethodOverloaded.  Deletes all of the files in the current directory matching a pattern  
Public Method Delete a directory in the current FTP directory. It deletes all files and sub directories within a directory.  
Public Method Delete a file in the current FTP directory  
Public Method Delete local-side port forwarding  
Public Method Removes a remote port forwarding.  
Public MethodReturns true if the Cyclic Redundancy Check Passes for all files in two local directories  
Public MethodCheck to see if an FTP directory exists.  
Public MethodDisable all logging.  
Public MethodExplicitly disconnect from the SFTP server.  
Public Method Disposes the object by canceling any async transfer and destroying the FTPRequest object  
Public MethodOverloaded. Download files matching the wildcard pattern.  
Public MethodOverloaded. Download files matching the wildcard pattern.  
Public Method Download a directory and all subdirectories in Parallel using two threads and two SFTP connections  
Public Method Download a directory and all subdirectories in Parallel using two threads and two SFTP connections  
Public MethodOverloaded. Download a file name synchronously using FTP  
Public MethodOverloaded.  Download a file from the SSH server asynchronously from the specified byte offset.  
Public Method Download files in Parallel using two threads with two SFTP connections  
Public Method Download files in Parallel as an Async Task using two threads with two SFTP connections  
Public MethodOverloaded. Download to a file stream from the FTP Server synchronously.  
Public MethodOverloaded.  Download to a file stream from the SSH server asynchronously from the specified byte offset.  
Public MethodOverloaded.  Log all FTP commands, responses, and exceptions to the console.  
Public Method Execute a shell command on an SSH Server  
Public Method Check to see if a file exists in the current FTP directory  
Public MethodReturns true if a file exists in the current directory matching the regular expression  
Public MethodReturns true if a file exists in the current directory matching the wildcard pattern  
Public Method Generate a public/private key pair for SSH.  
Public Method Recursively get a list of files in the specified directory and all subdirectories  
Public MethodGet the CRC32 of a local file in hexadecimal  
Public MethodOverloaded.  Get a listing of the files in the current FTP directory and filter between a start and end date  
Public MethodGet a directory listing as XML  
Public MethodGets the size of a remote directory in bytes  
Public MethodGets the modification date of a remote file.  
Public MethodGets the file size of a remote file in bytes.  
Public Method Returns a snapshot of the current local port forwarding configurations.  
Public Method Move a file on the SFTP Server  
Public Method Renames a directory in the current FTP directory  
Public MethodRenames a file in the current FTP directory.  
Public MethodAutomatically resume downloading a file where it was left off.  
Public MethodOverloaded.  Resume downloading a file asynchronously. It automatically starts at where it left off.  
Public MethodResume a download from the current stream position  
Public MethodResume an upload for a file synchronously using sftp. It automatically resumes where it left off.  
Public MethodOverloaded.  Resume an upload for a file asynchronously using sftp. It automatically resumes where it left off.  
Public MethodResume an upload from a local stream to an FTP file. It automatically starts at where it left off.  
Public MethodOverloaded.  Resume an upload from a local stream to an FTP file. It automatically starts at where it left off.  
Public Method Retry after a failed Asynchronous FTP Operation  
Public Method Create a directory using the SCP Protocol  
Public MethodOverloaded.  Get a file using the SCP Protocol  
Public MethodOverloaded.  Upload a file using the SCP Protocol  
Public Method Set file or directory permissions. It must be in the same format as the permissions string in the FileInfo  
Public Method Synchronize specified by name directory on current SFTP and destination SFTP.  
Public Method Synchronize specified by name directory on current SFTP and destination SFTP asynchronously  
Public Method Transfer specified by name file from current SFTP to destination SFTP.  
Public Method Transfer specified by name file from current SFTP to destination SFTP asynchronously.  
Public MethodSort an FTP Directory Listing  
Public MethodOverloaded.  Transfer files that do not exist locally synchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized.  
Public MethodOverloaded.  Transfer files that do not exist locally asynchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater than 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized.  
Public MethodOverloaded.  Transfer files that do not exist locally synchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized. Local files and directories will be deleted if they do not exist in the corresponding FTP directory.  
Public MethodOverloaded.  Transfer files that do not exist locally asynchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater than 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized. Local files and directories will be deleted if they do not exist in the corresponding FTP directory.  
Public MethodOverloaded.  Transfer files that do not exist locally synchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater than 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized.  
Public MethodOverloaded.  Transfer files that do not exist locally synchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater than 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized.  
Public MethodOverloaded.  Transfer files that do not exist locally synchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater than 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized. FTP files and directories will be deleted if they do not exist in the corresponding local directory.  
Public MethodOverloaded.  Transfer files that do not exist locally synchronously OR Files that have a different byte count OR Files that have a modification date difference in seconds greater than 60. The hour difference between the local machine and the SSH server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized. FTP files and directories will be deleted if they do not exist in the corresponding local directory.  
Public Method Get connected host  
Public MethodOverloaded.  Upload an entire directory, subdirectories, and files synchronously using sftp.  
Public MethodOverloaded.  Upload an entire directory, subdirectories, and files asynchronously using sftp.  
Public Method Upload a directory and all sub directories in parallel using two threads and two SFTP connections  
Public Method Download a directory and all sub directories in parallel using two threads and two SFTP connections  
Public MethodOverloaded. Upload a file name synchronously using FTP  
Public MethodOverloaded. Upload a file asynchronously.  
Public Method Upload files in Parallel using two threads with two SFTP connections  
Public Method Upload files in Parallel as an Async Task using two threads with two SFTP connections  
Public MethodUpload a file with a unique file name synchronously using FTP  
Public MethodOverloaded. Upload a file stream to the SSH server synchronously.  
Public MethodOverloaded.  Upload a file stream asynchronously to the SSH server  
Public MethodTranslate a wildcard pattern to a regex string  
Top
Protected Methods
 NameDescription
Protected Method Finalize  
Top
Public Events
 NameDescription
Public Event Occurs when there is something to log  
Public Event Fired when a command is sent to the FTP server  
Public Event Fired when an exception occurs during an asyncronous operation  
Public Event Fired for upload/download progress of the current file  
Public Event Fired when an asynchronous transfer has completed  
Public Event When downloading/uploading directories this is the overall progress  
Public Event Fired when a response is received from the FTP Sever  
Public Event Fired when an asynchronous transfer has cancelled  
Public Event Fired when an asynchronous transfere has completed  
Public Event Fired when an asynchronous transfer has started  
Top
See Also

Reference

SFTP Class
KellermanSoftware.NetSFtpLibrary Namespace