Minizip: Zip and UnZip additionnal library

Minizip: Zip and UnZip additionnal library


Click here to download Minizip (zip/unzip) package for zLib version 1.01.

This package enables to extract files from a .zip archive file. It is compatible with PKZip 2.04g, WinZip, InfoZip, MimarSinan Codex Suite 2002 tools, and compatible sofware.
It runs both under Linux and Windows, and probably other systems too. Encryption, multi-volume Zip files (span), and old compression methods used by old PKZip 1.x are not supported.
See or for the specification of ZIP format (or for older versions). Pkware provides also and an HTML page with the specification.

What is Minizip (Zip/Unzip)?

The Zlib library allows to deflate compressed files and to create gzip (.gz) files. Zlib is free software and small.

An archive in ZIP format can contain several files compressed with this method, while a .gz archive can containt only one file. It is a very popular format, that is why I have written a package for reading files compressed within a Zip archive.

How to get the Minizip package

You need the source code of Zlib ( or zlib-1.2.3.tar.gz. For previous version, get, or by FTP
Now, with version 1.23 and 1.14 of zLib, the Minizip library is inlucded in the contrib/minizip directory.

In there is the Win32 Windows DLL of my Windows DLL named Zlibwapi.dll that contains both zLib and Minilib.
For previous version, in you will find Windows DLL (Win16 and Win32) and static library (Win32) of Zlib 1.14 WITH zip/unzip package.
Please note I have added in the version of zip.c/unzip.c (0.21).
You must read zip.h and unzip.h, which contains the documentation of the zip and unzip functions.

March 2003: you can get version 0.21 with support of custom I/O functions to read and write zip files, and raw I/O (in order to duplicate files from one zip archive to another without uncompressing nor compressing). There is also a modified version of unzip with uncrypting, written by Terry Thorsen).
You can also get version 0.22e with crypting/uncrypting (do a #define NOCRYPT if you don't need it) and adding a file to an existing Zip archive.

22 September 2004: You can now download version 1.01e, with minor bugfixes.
Justin Fletcher wrote a very simple implementation of a memory access method for the ioapi code ( Ivan A. Krestinin wrote a small example of how delete a file from zip archive. This example is not fully tested (memory leaks are possible if the source archive is corrupt), but it might help you.

Unzipping files

The source code is made of only two files: unzip.h and unzip.c (plus ioapi.c and a few other include files). It uses the Zlib library.

miniunz.c is a very simple, but real unzip program. It can display files contained in a Zip archive or extract them.

Zipping files

The source code is made of only two files: zip.h and zip.c (plus ioapi.c and a few other include files). It uses the Zlib library.

minizip.c is a very simple, but real zip program.

A C++ Wrapper

Daniel Godson made a C++ wrapper to the zip/unzip library. Another can be found at Troels page.

A full MFC sample

In the CodeGuru developers site, there is an excellent example, 'Implementing a "Send as ZIP-File" command in Scribble' written by Stefan Kuhr. Unfortunately, this example is not built with the good, standard zLib DLL (see the DLL page). Download for a fixed project which uses the good DLL.

Extension to Minizip

Troels K. worked hard on the Minizip library. He has made several add-on, including a proposal for unzAttach/unzDetach.

Other examples

Jukka Pihl wrote mod_ziplook Apache module. It enables to view zip archive files directly in Apache without extracting them to the filesystem. It also uses HTTP compression (supported by W3C, like Microsoft IIS, Apache mod_deflate and examples in python and jython. Bashuman Deb wrote a FTP paging Support for miniunz.


The Gilles vollant software forum contain a section about Minizip.

Please also email me for feedback.

Future of ZIP file format

It seems that the ZIP file format will changes. The web sites PCWorld (and this new article), IDG, SlashDot contain information about ZIP's future. PkWare site contains a new specification, InfoZip has also a ZIP specification. WinZip specifies also new encryption. The PKWare specification mentions a new BZip2 compression method (there is a "zlib-like" library for BZip2 compression).


Latest revision : 2005-07-20 Valid XHTML 1.0!

posted on 2007-04-09 17:20 zmj 阅读(5838) 评论(5)  编辑 收藏 引用


# re: Minizip: Zip and UnZip additionnal library 2007-06-21 22:57 sdfgs  回复  更多评论   

# re: Minizip: Zip and UnZip additionnal library 2010-09-07 13:15 REEDJamie

I guess that to receive the <a href="">home loans</a> from creditors you must have a good reason. Nevertheless, once I have got a sba loan, just because I wanted to buy a building.   回复  更多评论   

# re: Minizip: Zip and UnZip additionnal library 2010-09-10 18:12 write my essay

When you have a chance to use the buy papers online service, do not hesitate, purchase custom academic papers and take a rest.   回复  更多评论   

# re: Minizip: Zip and UnZip additionnal library 2010-09-10 20:35 buy college essays

Generally, university students use purchasing essays options at the first writing firm they see in the web. That supposes to be not correct just because they may get a cheating company. So, it is worth to be delicate with such issues.   回复  更多评论   

# re: Minizip: Zip and UnZip additionnal library 2010-09-30 17:28 Online Education

.GZ format is using at linux I need to ask ask we can open .GZ files in windows environment.   回复  更多评论   

# re: Minizip: Zip and UnZip additionnal library 2011-09-03 14:57 skill games

이 좋은 기사 주셔서 감사합니다.  回复  更多评论   

【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理