CodeIgniter Forums
ZIP library query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: ZIP library query (/showthread.php?tid=64592)



ZIP library query - MoFish - 03-09-2016

Hi,

I have a folder called "skeleton" which sits in the root of my website. Inside the folder is a selection of folders and files.

Using code ignitors built in zip library I have managed to successfully zip the folder with all the child files/folders, however it is also including the root "skeleton" folder inside the zip file which i'm trying to exclude. Does anyone know if there is a way to exclude the root directory you are zipping? I have had a read of the documentation at https://ellislab.com...raries/zip.html and cannot find the answer or am simply overlooking it.

My code is as follows:

PHP Code:
$this->zip->read_dir("./skeleton"false);
$this->zip->archive($this->skeleton_path."remote_skeleton.zip"); 

Any help much appreciated.

Thanks,


RE: ZIP library query - arma7x - 03-09-2016

Read guide from here http://www.codeigniter.com/user_guide/libraries/zip.html. Documentation from https://ellislab.com/ probally outdated.


RE: ZIP library query - MoFish - 03-10-2016

Thank you arma7x, got it working after reading the documentation. I didn't realise i was reading an old version.