Programming Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C Examples

Bounced Mail
Bz2
Certificates/Keys
Charset
CSV
DKIM / DomainKey
Diffie-Hellman
DSA
Email Object
Encryption
FileAccess
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
MIME
NTLM
POP3
RSA
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
Zip
Amazon S3

 

 

 

 

 

 

 

 

(C) FTP using Explicit SSL/TLS (AUTH TLS, AUTH SSL, FTPES)

Demonstrates how to connect using AUTH SSL (also known as FTPES). By setting the AuthTls property, a secure FTP connection can be established using either SSL 3.0 or TLS 1.0. The Chilkat component will automatically choose whichever is supported by the FTP server during the secure channel establishment. The FTP control port remains at the default (21). Upon connection, the channel is converted to a secure channel automatically. All control messages and data transfers are encrypted.

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries
#include <C_CkFtp2.h>

void ChilkatSample(void)
    {
    HCkFtp2 ftp;
    BOOL success;

    ftp = CkFtp2_Create();

    //  Any string unlocks the component for the 1st 30-days.
    success = CkFtp2_UnlockComponent(ftp,"Anything for 30-day trial");
    if (success != TRUE) {
        printf("%s\n",CkFtp2_lastErrorText(ftp));
        return;
    }

    //  If this example does not work, try using passive mode
    //  by setting this to TRUE.
    CkFtp2_putPassive(ftp,FALSE);

    //  You may use this account for testing.
    //  This account allows for directory listings and files
    //  to be downloaded.  However, file uploads are not allowed.
    CkFtp2_putHostname(ftp,"ftp.secureftp-test.com");
    CkFtp2_putUsername(ftp,"test");
    CkFtp2_putPassword(ftp,"test");

    //  Establish an AUTH SSL secure channel after connection
    //  on the standard FTP port 21.
    CkFtp2_putAuthTls(ftp,TRUE);

    //  The Ssl property is for establishing an implicit SSL connection
    //  on port 990.  Do not set it.
    CkFtp2_putSsl(ftp,FALSE);

    //  Connect and login to the FTP server.
    success = CkFtp2_Connect(ftp);
    if (success != TRUE) {
        printf("%s\n",CkFtp2_lastErrorText(ftp));
        return;
    }
    else {
        //  LastErrorText contains information even when
        //  successful. This allows you to visually verify
        //  that the secure connection actually occurred.
        printf("%s\n",CkFtp2_lastErrorText(ftp));
    }

    printf("Secure FTP Channel Established!\n");

    //  Do whatever you're doing to do ...
    //  upload files, download files, etc...

    CkFtp2_Disconnect(ftp);

    CkFtp2_Dispose(ftp);

    }

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.