Delphi Examples

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

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
NTLM
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

FTP Download File

Download 32-bit Chilkat FTP2 ActiveX (.msi)

Download All 32-bit Chilkat ActiveX Components (.zip)

Download All 64-bit Chilkat ActiveX Components (.zip)

Delphi example program to download a file from an FTP server with progress monitoring.

// FTP download with progress monitoring
procedure TForm1.Button2Click(Sender: TObject);
var
  success: Integer;
  localFilename: WideString;
  remoteFilename: WideString;

begin
  // Import the Chilkat FTP-2 ActiveX control into Delphi and then
  // drop an instance of the FTP control onto the form.

  // Unlock once at the beginning of your program.
  ChilkatFtp21.UnlockComponent('anything for 30-day trial');

  ChilkatFtp21.Hostname := 'ftp.chilkatsoft.com';
  ChilkatFtp21.Username := '***';
  ChilkatFtp21.Password := '***';

  // Connect to the server
  success := ChilkatFtp21.Connect();
  if (success = 1) then
    begin
      localFilename := 'test2.txt';
      remoteFilename := 'test.txt';
      // Download test.txt from the FTP server and save it as 'test2.txt'
      // on the local system.
      success := ChilkatFtp21.GetFile(remoteFilename,localFilename);
      if (success = 0) then
        begin
          ChilkatFtp21.SaveLastError('ftpDownloadError.txt');
           ShowMessage('Error in download. See error log');
       end
      else
        ShowMessage('File downloaded!');
    end
  else
    begin
      ChilkatFtp21.SaveLastError('ftpConnectError.txt');
      if (ChilkatFtp21.ConnectVerified = 1) then
        ShowMessage('Login error. Check your username/password')
      else
        ShowMessage('Cannot connect to FTP server');
    end;

end;

// Get (download) event callback.  This method is called each time
// the percentage-completion updates to a higher value.
procedure TForm1.ChilkatFtp21GetProgress(ASender: TObject;
  pctDone: Integer);
begin
  // pctDone holds an integer value between 1 and 100.
  ProgressBar1.Position := pctDone;
end;

 

 

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

Mail Component · .NET Email Component · XML Parser