Thursday, 21 August 2014

How to create and extract ZIP files in Delphi XE6?

How to create and extract ZIP files in Delphi XE6?

Delphi provides System.Zip unit for creating ZIP files. System.Zip unit contains a simple ZIP extractor and creator class named TZIPFile. TZIPFile class mainly has three methods which are used to create and extract zip files:

ZipDirectoryContents: Creates the zipped file
IsValid: Validates the zip file
ExtractZipFile: Extracts the zip file

Following is the code snippet in Delphi to create a zip file.

uses System.Zip;

TZIPFile.ZipDirectoryContents('C:\FolderToZip', 'C:\');

Following is the code snippet in Delphi to extract a zip files. 

uses System.Zip;

ZipFile := ''; //This is my zip file
if TZipFile.IsValid(ZipFile) then //Validate zip file
  TZipFile.ExtractZipFile(ZipFile, 'C:\DestinationDirectory'); //Extract the zip file
  ShowMessage('Zip File is not valid');


  1. You have a real ability for writing unique content. I like how you think and the way you represent your views in this article. I agree with your way of thinking. Thank you for sharing.
    unblocked games| unblocked games at school| unblocked games| friv4school| friv for school| tetris unblocked| friv games| frivgames| barbie games| barbiegames| monster high games| kizi2| kizi 2

  2. Big Farm

    Big Farm is an awesome multiplayer farm management game made by the Goodgame Studios.
    Your mission is simple: Create a big farm, grow crops, breed animals,
    and become the richest farmer of the universe. Enjoy Goodgame's Big Farm!