Tuesday, November 1, 2011

PHP, compress and extract files using PclZip library

PclZip library offers PHP compression and extraction functions for Zip formatted archives. PclZip library can be downloaded from:

The user menu can be found HERE.

To include pclzip library:
To add or extract very large file, "memory_limit" value in php.ini needs to be increased. "memory_limit" can also set in the PHP code:
To initialize a zip instance:
 $myzipfile = new PclZip('myzfile.zip');
To create a zip file from image1.jpg and image2.jpg:
$mylist $archive->create('mydata/image1.jpg,mydata/image2.jpg',

No comments:

Post a Comment