NET FTP Library
FTP Class Members
Properties  Methods  Events


KellermanSoftware.NetFtpLibrary Namespace : FTP Class

The following tables list the members exposed by FTP.

Public Constructors
 NameDescription
Public ConstructorOverloaded.   
Top
Public Properties
 NameDescription
Public Property Account Name to use for the lesser used ACCT command required by some FTP Servers This is different than the UserName and Password  
Public Property Account Password to use for the lesser used ACCT command required by some FTP Servers This is different than the UserName and Password  
Public Property By default the .NET FTP Library assumes your FTP Server supports the APPE command when connections are lost. If set to false, the entire file is re-transfered when the connection is lost  
Public Property If true there is an Asynchronous tranfer in progress  
Public Property Specify the Buffer Size for transfers in bytes. The default is 4096.  
Public Property  
Public Property If true, ensure the integrity of the transfer by issuing an XCRC. Your FTP Server must support XCRC. See the Features() method.  
Public Property Use a local X509 Client Certificate to encrypt an SSL FTP Session  
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

Contains regular expression formats to parse the date and time portion of FTP directory listings. You may add your own date/time parsing format for your FTP server. Please put the parsing expressions into .NET regular expression groups. See the examples below.

Regular Expression Groups

  • month
  • day
  • year
  • hour
  • minute
  • m - am/pm designator
 
Public Property When EnableLogging() is used, performs verbose logging of SSL Certificates and Streams  
Public Property When uploading/downloading directories, this is the total number of directories and sub directories to be transferred.  
Public Property

Contains regular expression formats to parse FTP directory listings. By default if a directory entry cannot be parsed it is not put into the list. To see lines that cannot be parsed, turn on StrictDirectoryParsing. You may add your own parsing formats to the list. Please use these regular expression groups. See the examples below.

Regular Expression Groups

  • dir - Directory flag
  • permission - Permissions for the file or directory
  • size - The size of the file
  • timestamp - The date and time information (This is further parsed by the DateParseFormats)
  • name - The name of the file or directory
 
Public Property If true the FTP component connects via SSL using the AUTH TLS command. The remote FTP server must have an SSL certificate installed for the FTP server in order to use SSL.  
Public Property By default, any SSL Certificate errors are ignored. If EnsureCertificates is set to true, SSL Certificate errors will be thrown as exceptions  
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: _ftp.Connect(); _ftp.CurrentDirectory="MyDirectory"; _ftp.ExactDirectoryMode=false;  
Public Property When uploading/downloading directories this is the total number of files to be transferred.  
Public Property Directory Separator Character. Default is '/'  
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 Property Gets or sets the implicit SSL port. The default is 990  
Public Property The IP End Point of the remote server  
Public PropertyReturns true when any FTP operation is in progress.  
Public Property  
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 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 Pad a zero to the front of the local CRC if there is an odd number of digits. Some FTP Servers add a pad of zero to the front if there is an odd number of digits and some do not. The default 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 When connecting to SSL by default it tries to issue a PBSZ 0 before logging in. By setting to true it only tries PBSZ 0 after logging in. The default is false.  
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 When a connection is lost and we are attempting to reconnect. This command is sent to ensure the server is responding. This defaults to NOOP  
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 file is attempted to be appended  
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 The SSL or TLS protocol (The default is SslProtocols.Default which is SSL 3.0 or TLS 1.0)  
Public Property When doing a GetDirectoryListing if a directory line cannot be parsed, throw an exception. The default is false.  
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 When EnableSSL is true, the default is to use AUTH TLS when connecting. If this property is set to true, use AUTH SSL  
Public Property If true, use binary transfer mode else use ascii mode. The default mode is binary.  
Public Property Issue a CCC (Clear Command Channel) after connecting with SSL. Required for some FTP Servers when using a NAT.  
Public Property Uses the host IP Address instead of the PASV IP Address Response. Sometimes required when using a NAT.  
Public Property Use Mode Z Compression for Data Transfers  
Public PropertyIf true, use passive FTP mode. The default is passive mode.  
Public Property By default, Port 990 means implicit SSL. Setting to false will allow non-ssl on port 990 or explicit SSL on port 990  
Public PropertySpecifies the user name to use while communicating with the FTP Server.  
Public Property When UseStandardDirectoryListing is true, a MLSD command is given to get the directory listing instead of the LIST command. Permissions are not available with MLSD  
Public Property Use UTF-8 encoding  
Top
Protected Properties
 NameDescription
Protected Property  
Protected Property  
Protected Property  
Protected Property Custom object that the user sets during an async transfer  
Protected Property  
Protected Property  
Protected Property The last time we made a successfull connection  
Top
Public Methods
 NameDescription
Public Method Calculate 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 Method Cancels any async transfers  
Public MethodOverloaded.  Clear the file log  
Public Method Compress the passed bytes using the specified compression type  
Public Method Compress a file using the specified compression type  
Public Method Compress a stream using the specified compression type  
Public Method Open the FTP Server connection explicitly and leave it open until explicitly closed.  
Public Method Returns true if the CRC matches for the local file and the FTP file The FTP server must support the XCRC command  
Public Method Return 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 Decompress the passed bytes using the specified compression type  
Public Method Decompress a file using the specified compression type  
Public Method Decompress a stream using the specified compression type  
Public Method Delete 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 Returns true if the Cyclic Redundancy Check Passes for all files in two local directories  
Public MethodCheck to see if an FTP directory exists.  
Public Method Disable all logging.  
Public MethodExplicitly disconnect from the FTP server.  
Public Method Disposes the object by canceling any async transfer and destroying the FTPRequest object  
Public Method Download the chunk of a file into a local stream  
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 FTP connections  
Public Method Download a directory and all subdirectories in Parallel using two threads and two FTP connections  
Public MethodOverloaded.  Download a file name synchronously using FTP  
Public MethodOverloaded.  Download a file from the FTP server asynchronously from the specified byte offset.  
Public Method Download files in Parallel using two threads with two FTP connections  
Public Method Download files in Parallel as an Async Task using two threads with two FTP connections  
Public MethodOverloaded. Download to a file stream from the FTP Server synchronously.  
Public MethodOverloaded.  Download to a file stream from the FTP server asynchronously from the specified byte offset.  
Public MethodOverloaded.  Log all FTP operations to a memory stream.  
Public Method Return a list of features supported by the FTP Server by issuing a FEAT command.  
Public Method Check to see if a file exists in the current FTP directory  
Public Method Returns true if a file exists in the current directory matching the regular expression  
Public Method Returns true if a file exists in the current directory matching the wildcard pattern  
Public Method Recursively get all the files in the specified FTP Directory and all subdirectories  
Public Method Get 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 Method Get 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 MethodGet the FTP Server type (uses the SYST command)  
Public Method Uses NLST to get a list of the file names in the current directory See also: GetRawDirectoryListing, GetDirectoryListing  
Public MethodOverloaded.  Returns the raw directory listing of the current FTP folder via the LIST command  
Public Method Returns a raw standard directory listing of the current FTP folder via the MLSD command  
Public Method Get the first bytes in a file  
Public Method Get the XCRC aka CRC32 of an FTP file in hexadecimal. The FTP Server must support XCRC. See the Features() method  
Public Method Returns a list of supported commands on the FTP Server by issuing a HELP Command  
Public Method Move a file on the FTP Server  
Public Method Parse the directory listing into a list of FTPFileInfo objects This is used for unit testing of directory formats  
Public Method Parse a Standardized Directory Listing returned from an MLSD command  
Public MethodOverloaded.  Upload an ASCII file  
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 Method Resume a download from the current stream position  
Public Method Resume an upload for a file synchronously using FTP. It automatically resumes where it left off.  
Public MethodOverloaded.  Resume an upload for a file asynchronously using FTP. It automatically resumes where it left off.  
Public Method Resume 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 Send a No Operation command  
Public MethodOverloaded.  Send a raw FTP command  
Public Method Synchronize specified by name directory on current FTP and destination FTP.  
Public Method Synchronize specified by name directory on current FTP and destination FTP asynchronously.  
Public Method Transfer specified by name file from current FTP to destination FTP.  
Public Method Transfer specified by name file from current FTP to destination FTP asynchronously.  
Public Method Sort an FTP Directory Listing  
Public Method Issue a STAT command to the FTP Server and return the current statistics for the FTP Session  
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 FTP 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 FTP 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 FTP 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 FTP 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 FTP server is taken into account when CalcHourDifference has been called. By default all files and sub directories are attempted to be synchronized.  
Public MethodOverloaded.  Synchronize Upload a Directory and Exclude a List of files, directories, or wildcards  
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 FTP 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.  Synchronize Upload a Directory With Delete and Exclude a List of files, directories, or wildcards  
Public Method Append a chunk to the end of a file  
Public MethodOverloaded.  Upload an entire directory, subdirectories, and files synchronously using FTP.  
Public MethodOverloaded.  Upload an entire directory, subdirectories, and files asynchronously using FTP.  
Public Method Upload a directory and all sub directories in parallel using two threads and two FTP connections  
Public Method Download a directory and all sub directories in parallel using two threads and two FTP 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 FTP connections  
Public Method Upload files in Parallel as an Async Task using two threads with two FTP connections  
Public Method Upload a file with a unique file name synchronously using FTP  
Public MethodOverloaded. Upload a file stream to the FTP server synchronously.  
Public MethodOverloaded.  Upload a file stream asynchronously to the FTP server  
Public Method Translate a wildcard pattern to a regex string  
Top
Protected Methods
 NameDescription
Protected Method  
Protected Method Finalize  
Protected Method Calculates the current and average transfer speed, throttling it if needed  
Protected Method Verify that the FTP directory exists  
Protected Method Ensure that the local directory can be written to  
Protected Method Verify that the local stream can be downloaded  
Protected Method Ensure the local stream can be uploaded  
Top
Public Events
 NameDescription
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 transfer has completed  
Public Event Fired when an asynchronous transfer has started  
Top
See Also

Reference

FTP Class
KellermanSoftware.NetFtpLibrary Namespace