forked from bcit-ci/CodeIgniter
-
Notifications
You must be signed in to change notification settings - Fork 0
Unzip
World Wide Web Server edited this page Jul 4, 2012
·
16 revisions
Unzip 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.
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
[code] $this->load->library('unzip'); [/code]
After loading the class it needs to be initialized. Also this is on the standard CI way:
[code] $config['fileName'] = './uploads/test.zip'; $config['targetDir'] = './uploads'; $this->zip->initialize($config); [/code]
And finaly we can use it.
[code] $this->zip->unzipAll();
//display's error messages echo $this->zip->display_errors(2);
//display's information messages echo $this->zip->display_errors(1); [/code]