Discuss this help topic in SecureBlackbox Forum

Save the archive to the file

To save the archive to the file you may use either synchronous or asynchronous compression.

In the first case, once the archive has been populated, simply call TElZIPWriter.Compress() method and pass the destination file name as a parameter.

For asynchronous compression, the following steps should be performed:

  1. call TElZIPWriter.BeginCompression() method,
  2. use TElZIPWriter.Add() method one or more times to add entries,
  3. after adding each entry, call TElZIPWriter.UpdateCompression() method,
  4. finally, call TElZIPWriter.EndCompression() method.

Example:
TElZipWriter ZipWriter = new TElZipWriter();
ZipWriter.BeginCompression("c:\\myarchive.zip");
ZipWriter.Add("C:\\temp.txt");
ZipWriter.UpdateCompression();
ZipWriter.Add("C:\\temp.pdf");
ZipWriter.UpdateCompression();
ZipWriter.EndCompression();

How To articles about Zip file operations

Discuss this help topic in SecureBlackbox Forum