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

Create Zip with Full Directory Paths Saved

Download Chilkat 32-bit Zip ActiveX (.msi) (includes objects for .zip, .gz, .bz2, and .Z)

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

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

Delphi sample program to create a zip with the full directory paths maintained.

// Create a .zip file using AppendFilesEx and saving the extra path information.
procedure TForm1.Button4Click(Sender: TObject);
var
  recurse: Integer;
  success: Integer;
  saveExtraPath: Integer;
  archiveOnly: Integer;
  includeHidden: Integer;
  includeSystem: Integer;

begin
  // UnlockComponent should be called once at the beginning of a program.
  ChilkatZip21.UnlockComponent('anything for 30-day trial');

  // Initialize the zip object.
  ChilkatZip21.NewZip('testWithPaths.zip');

  // Add a directory tree to the zip object.  The AppendFilesEx
  // method recursively descends a directory and adds references to
  // files and directories to the zip object.  When the
  // zip is written (by calling WriteZipAndClose) all referenced files
  // and directories are added.
  recurse := 1;
  saveExtraPath := 1;   // Yes, save the path info...
  archiveOnly := 0;
  includeHidden := 1;
  includeSystem := 1;
  ChilkatZip21.AppendFilesEx('c:/temp/abc/*', recurse, saveExtraPath,
    archiveOnly, includeHidden, includeSystem);

  {
    The directory tree on disk looks like this:

C:\temp\abc\dudeA.gif
C:\temp\abc\setup.exe
C:\temp\abc\b\
C:\temp\abc\b\dudeAbc.gif
C:\temp\abc\b\dudeXyz.gif
C:\temp\abc\b\Setup.exe
C:\temp\abc\b\123\
C:\temp\abc\b\123\dude123.gif
C:\temp\abc\b\123\test.txt

    The directory tree in the .zip looks like this:

temp\abc\dudeA.gif
temp\abc\setup.exe
temp\abc\b\
temp\abc\b\dudeAbc.gif
temp\abc\b\dudeXyz.gif
temp\abc\b\Setup.exe
temp\abc\b\123\
temp\abc\b\123\dude123.gif
temp\abc\b\123\test.txt

  }

  success := ChilkatZip21.WriteZipAndClose();
  if (success = 0) then begin
      ChilkatZip21.SaveLastError('zipErrorLog.txt');
      ShowMessage(ChilkatZip21.LastErrorText);
  end;

  ShowMessage('Done!');

end;

 

 

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

Mail Component · .NET Email Component · XML Parser