ImageEn, unit iemio

TImageEnMIO.ExtractFromFileZIP

TImageEnMIO.ExtractFromFileZIP


Declaration

function ExtractFromFileZIP(const FileName: string; SelectedOnly: Boolean; const DestFolder: string; UseFullPath: Boolean = True; const Password: string = ''): Boolean; overload;
function ExtractFromFileZIP(const FileName: string; FileIndex: Integer; const DestFolder: string; UseFullPath: Boolean = True; const Password: string = ''): Boolean; overload;
function ExtractFromFileZIP(const FileName: string; FileIndexes: TCardinalArray; Count: Integer; const DestFolder: string; UseFullPath: Boolean = True; const Password: string = ''): Boolean; overload;


Description

Extracts one or all files from ZIP archive to the specified folder.
If SelectedOnly = true, the selected files in the associated TImageEnMView will be extracted (selected folders will be ignored). If SelectedOnly = False, all files will be extracted. Otherwise you can specify the indexes of one or more files.
If UseFullPath = False, then all files will be output to the specified folder. If UseFullPath = true, then the folder structure of the zip will be created within the specified path.
If the file is encrypted you can specify the password (otherwise a password prompt will be displayed if AutoPromptForPassword is enabled).
Result will be false if the file is not ZIP format or no ZIP plug-in is available (Aborting will be true). Errors due to a file not being available will raise an exception.



Note:
 ZIP extraction requires the 7z plug-in from: www.imageen.com/download/
 To abort while extracting set Aborting to true
 Read more about ImageEn ZIP Support


Examples

// Extract all files from a zip (Recreating the internal zip folder structure)
ImageEnMView1.MIO.ExtractFromFileZIP( 'C:\test.zip', False, 'D:\Out\', True );

// Extract the selected files from a zip
ImageEnMView1.MIO.ExtractFromFileZIP( 'C:\test.zip', True, 'D:\Out\', False );

// Extract the first file from a zip
ImageEnMView1.MIO.ExtractFromFileZIP( 'C:\test.zip', 0, 'D:\Out\', False );

// Extract file of a specific filename within the zip
ImageEnMView1.MIO.ExtractFromFileZIP( 'C:\test.zip\Path\image.jpeg', -1, 'D:\Out\', False );

// Extract three files from a zip
images[0] := 2;
images[1] := 4;
images[2] := 5;
ImageEnMView1.MIO.ExtractFromFileZIP( 'C:\test.zip', images, 3, 'D:\Out\ );