Version: 2.0.7
Add SSL authentication and encryption to ensure your data stays private as it travels across the public network.

SecureFtp ActiveX Control

Use the SecureFtp control to automatically authenticate and encrypt/decrypt all data sent and received over an FTP connection using SSL2, SSL3, PCT, and TLS. Features include:

  • Select SSL 2.0, SSL 3.0, PCT, TLS or unencrypted FTP communications.
  • Customize certificate acceptance or rejection.
  • Client authentication fully supported.
  • Use the Get method to download ANY file with only one line of code or use the Put method to upload ANY file with only one line of code!
  • FTP Restart command is fully integrated.
  • The Mget and Mput methods make handling multiple files (even directory trees) easy.
  • Uniquely capable of SSL over FTP through a Firewall using Dart's proprietary FirewallReady functionality (requires PowerTCP products on both sides of the connection).
  • Retrieve and Store methods handle file transfers and include automatic support for restarting transfers that were previously incomplete.
  • FTP includes full support for large files (files over 2 GB in size).
  • File transfer options are set using simple properties and are automatically sent only when needed, making this control exceptionally efficient AND easy-to-use.
  • Files can be transferred between the server and disk OR memory, making this versatile control a superior performer for advanced applications.
  • Listing property formats listings into properties for file name, size etc., eliminating the need to write and debug parsing code.
  • Standard (unencrypted) mode has built-in support for SOCKS4/5, USER(LOGIN/NOLOGIN), OPEN, SITE(LOGIN/NOLOGIN), and PIPE Proxies and the power to customize for a proprietary Proxy server.

Looking for the .NET version of this control?

Development Environments

  • Visual Studio .NET (.NET Framework)
  • Visual Basic (VB)
  • Visual C++ (VC++)
  • FoxPro
  • PowerBuilder
  • Delphi
  • C++ Builder
  • ASP
  • Office 97/2000

Interface

Public Properties
Allocate Indicates whether space must be allocated on a server as part of the Store method.
Authentication Specifies the security protocol and authentication type used.
Blocked A True value indicates the control is currently executing a blocking method (Timeout is greater than 0), which has neither completed nor timed out with a ptTimeout error.
Certificate Certificate Object to use when authenticating to the remote host.
Directory Working directory on the server.
FileStructure File structure to be used for subsequent file transfers.
Listing Object containing results from the last use of the List method or the NameList method.
LocalAddress Returns the address of the local host in dot notation (for example, nnn.nnn.nnn.nnn). When not connected, it returns an empty string.
LocalDataPort Gets or sets a string used to restrict the local data port to a value or range compatible with your firewall.
LocalPort Returns the port number that the socket is bound to. When not connected, it returns 0.
Passive Indicates how the data connection is formed.
Protocol Specifies the security protocol used.
RemoteAddress Returns the address of the remote host in dot notation (i.e. nnn.nnn.nnn.nnn) when the State property is tcpConnected.
RemotePort Returns the port number of the remote host when the State property is tcpConnected.
Restart Indicates the server supports a restart mechanism for file downloads.
SecretKey Sets the secret key used in password encryption.
Security Sets the security level during communication.
State Provides status information to the user interface. The State event fires to signal that this property has changed.
StoreType Type of store that will be performed when the Store method is called.
System Type of operating system used by the server.
Timeout Controls the blocking behavior of methods that can be used in blocking and non-blocking ways.
TransferMode Transfer mode to be used for subsequent file transfers.
Type Data type to be used for subsequent file transfers.
Public Methods
Abort Abort any blocking method and release all system resources.
AbortCommand Gracefully abort the last command sent.
About Show the About Box.
ChangeDirectoryUp Set the working directory to the parent directory. The Directory property can be checked to discover the new working directory.
ClearCertificate Clears the Certificate object contained in the Cerificate property.
Command Send any command string to the server. This method is useful for using servers that have an extended vocabulary.
Delete Delete a file on the server.
Get Log in, get a file, and log out in one step.
Help Request helpful information from the server. The command takes an optional argument (for example, any command name) and returns more specific information as a response.
List Get a file directory listing. The server sends name and supplementary information on each file found within the specified PathName. The Listing property is populated with this information.
Login Connect to a server and send the commands to authenticate a session.
Logout Gracefully log off and terminate the connection.
MakeDirectory Create a directory.
NameList Get a file directory listing without file attributes. The server sends a file name for each file found within the PathName specified. The Listing property is filled with filenames (only the Name property is initialized).
NoOperation Check the status of the control connection. The server should send an OK reply.
Put Login, store a file, and logout in one easy step.
RemoveDirectory Remove a directory.
Rename Rename a file.
Retrieve Retrieve (get) a complete file or part of a file starting at a specified position.
Site Specify or request site-specific services. The nature of these services and the specification of their syntax can be found in the Result parameter of the Help method.
Status Get server status information.
Store Store (send) a complete file, or part of a file starting at a specified position.
StructureMount Mount a different file system data structure without altering login or accounting information.
Trace Start or stop the accumulation of trace or debug data. Once started, this method accumulates data until it is turned off.
Public Events
Authenticate Fires when the remote host has sent a certificate to be authenticated.
Certificate Fires when the remote host is requesting a certificate and the Certificate property is not set to a valid Certificate Object.
Error Fires when an error condition occurs.
Progress Fires when the server replies to a command or while a file transfer takes place. The control interprets the reply and presents progress information with this event.
State Fires when the State property changes.

Code Example

How easy is the SecureFTP Control to use? This example demonstrates creating a secure FTP client which can perform certificate authentication.

Private Sub SecurityTest2()
    ' The FTP server in this example is using Explicit SSL
    SecureFtp1.Authentication = atExplicitNormal

    ' Perform all checks in the Authenticate event
    SecureFtp1.Security = secureNormal

    ' Login to the server. Security will be negotiated first.
    SecureFtp1.Login "weezer", "test", "dart", , 21

    ' Success! SSL connection established. Get help on the STOR 
    ' command (just to test the SSL connection)
    Dim Response As String
    SecureFtp1.Help Response, "STOR"

    ' Print the response.
    Debug.Print (Response)

    ' Logout
    SecureFtp1.Logout
End Sub

Private Sub SecureFtp1_Authenticate(ByVal RemoteCertificate As DartSecureFtpCtl.ICertificate, 
ByVal TrustedRoot As Boolean, ByVal ValidDate As Boolean, ByVal ValidSignature As Boolean, 
Valid As Boolean)

    ' The server's certificate has been received.
    Dim Msg As String

    ' Check to see if it passed all the checks.
    If Not Valid Then
        ' It didn't, so check everything and give the user the option to accept/reject.
        If Not ValidDate Then Msg = Msg + "- Certificate date is invalid" + vbCrLf
        If Not TrustedRoot Then Msg = Msg + "- Certificate Authority is not trusted" 
        + vbCrLf
        If Not ValidSignature Then Msg = Msg + "- Certificate does not contain a valid 
        signature" + vbCrLf

        Msg = "The following conditions are true:" + vbCrLf + vbCrLf + Msg + vbCrLf 
        + vbCrLf
        Msg = Msg + "Do you still wish to authenticate?"
        If MsgBox(Msg, vbYesNo + vbExclamation, "Security Alert") = vbYes Then
            ' User still wants to accept so accept it (by setting Valid to true)
             Valid = True
         End If
     End If
End Sub