Home > CakePHP, Php programming > Zip Component in CakePHP-Add files in Zip

Zip Component in CakePHP-Add files in Zip

Hello Friends,

Today i have implemented a Zip functionality in CakePHP. If you want to create an archive file consists of some files to give a download Zip fileoption to user than i might help you to show the steps. Below are the steps how to zip all files and save it to some folder.

$this->Zip->addFile($src_file,$file_name_inzip);
$this->Zip->saveZip(“myzipfile.zip”);

First you can download the file given in link and place above file in components directory in your app/controller folder. Now you can call the function addFile for adding files in zip. Once you will call this function it will read all data from src_file. Now you can save those data to Zip file by calling saveZip function.

If you find any problem in this than let me know by comment.
Advertisements
  1. web guru
    June 6, 2011 at 5:16 am

    can you write down direct link to component as i cant download it from cakeforge website.

  2. January 19, 2013 at 5:36 am

    your link “Download Zip Component” is now working.plz let me know where i can download this zip component.thanks in adavance.

  3. January 19, 2013 at 5:36 am

    dhammadeep :
    your link “Download Zip Component” is not working.plz let me know where i can download this zip component.thanks in adavance.

  4. February 3, 2013 at 4:21 am

    @dhammadeep , Pl check above comment !

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: