Delphi Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Byte Array
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
Bzip2
LZW
Bz2
Icon

Type Conversion

 

Article: Understanding COM References in Delphi

TempDir Zip Property

Download Chilkat Zip ActiveX

Delphi example code to open a Zip archive, append a single file, and rewrite the .zip.

// Important information about the TempDir property.
{
  When the Chilkat Zip component writes a .zip file, it first
  writes a temporary .zip to the directory specified by the
  Zip.TempDir property.  The default value of TempDir is ".", which
  is the current working directory of the calling process.
  You should ensure that the calling process has permissions
  to create and/or write files in the TempDir.

  The TempDir is used to safeguard existing .zip files when
  rewriting.  The WriteZip and WriteZipAndClose methods write
  to a temporary .zip first, and if successful, renames it to
  the intended destination.  This ensures that existing .zip are not
  lost if the WriteZip method fails, or is aborted by the application.
}
procedure TForm1.Button6Click(Sender: TObject);
var
  recurse: Integer;
  success: 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('test.zip');

  // Add files...
  recurse := 1;
  ChilkatZip21.AppendFiles('c:/temp/abc/*', recurse);

  // Use c:\temp as our TempDir.
  ChilkatZip21.TempDir := 'c:\temp';

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

  ShowMessage('Done!');

end;

 

 

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

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

Mail Component · .NET Email Component · XML Parser