Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZLib unzip a zip containing multiple files

I am using delphi 7 and need to uncompress a compressed zip file which contains multiple files, I have found examples of how to unzip a single file using ZLib but cannot find any examples of this with muliple files in the zip, would it be possible for someone to either give me an example or point me in the direction of one

thanks

Colin

like image 441
colin Avatar asked May 16 '12 15:05

colin


2 Answers

If you're having problems with zlib, maybe you might want to consider TurboPower's Abbrevia (available on SourceForge). With Abbrevia, here's our multiple-file extract code:

zip.ArchiveType := atZip ;
zip.ForceType := true ;
zip.OpenArchive({...your .zip archive name});

zip.BaseDirectory :=  {...your extract path...} ;
zip.OnConfirmOverwrite := Overwrite
zip.ExtractFiles('*');

There's options to handle extraction failure, confirmation of overwrites, etc. It's a pretty nice library to work with, and it's free.

like image 73
Erik Knowles Avatar answered Oct 25 '22 18:10

Erik Knowles


There is an example in the zlib source distribution on zlib.net. Take a look at contrib/minizip/miniunz.c .

like image 22
Mark Adler Avatar answered Oct 25 '22 16:10

Mark Adler