Jump to content
MoFish

PHP CodeIgnitor - Zip Library Query

Recommended Posts

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 e.g.

-- skeleton
    -- areas
        -- uk.html
    -- pages
        -- contact.html
        -- index.html
    -- images
        -- panda.jpg
    -- javascript
        -- jquery.js

Using code ignitors built in zip library I have managed to successfully get zip a 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/codeigniter/user-guide/libraries/zip.html and cannot find the answer or am simply overlooking it.

 

My code is as follows:

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

Any help much appreciated.

 

Thanks,

 

MoFish

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.