ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
Jam.Shell.Dialogs.FileOperation.TJamFileOperation.Zip

Appends files to a ZIP file.

Syntax
Pascal
class procedure Zip(const pFileNames: IItemIdListCollection; const pZipFile: IItemIdList); overload; static;
Parameters 
Description 
const pFileNames: IItemIdListCollection 
Files who should be appended to a ZIP file.  
const pZipFile: IItemIdList 
The ZIP file (must be a filesystem path).  

IMPORTANT: The operation is performed on a background thread!

Exceptions 
Description 
if pFileNames contains no valid ItemIdList or pZipFile is invalid or if any COM exception occured.  

The following example shows how to append multiple files to a ZIP file:

  var
    Files: IItemIdListCollection;
    ZipFile: IItemIdList;
  begin
    Files := TItemIdListCollection.Create;
    Files.Add('C:UsersPublicMusicsample.mp3');
    Files.Add('C:UsersPublicMusicsample2.mp3');
    ZipFile := TJamItemIdList.Create('C:Zipfile.zip');
    TJamFileOperation.Zip(Files, ZipFile);
  end;