Part of the EllisLab Network
x
 
Create New Page
 View Previous Changes    ( Last updated by {author} )

Revision: Unzip

Revision from: 06:58, 5 Feb 2009

Category:Library -> Zip | Category:Library -> Community
This class allows programmer to easily unzip files on the fly. The origial class was made by “Alexandre Tedeschi” I modified it to an code codeigniter library.

Requirements:

This class requires extension ZLib Enabled. It is default for most site hosts around the world, and for the PHP Win32 dist.

usage

Simply load the class like any other CI library

$this->load->library('unzip'); 

After loading the class it needs to be initialized. Also this is on the standard CI way:

$config['fileName']  './uploads/test.zip';
$config['targetDir''./uploads'
$this->unzip->initialize($config); 

And finaly we can use it.

$this->unzip->unzipAll();

//display's error messages
echo $this->unzip->display_errors(2);

//display's information messages
echo $this->unzip->display_errors(1); 

This what’s all about. The class:

Categories: