Jump to content

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

 

Link to post
Share on other sites
This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.