Sunday, July 17, 2011

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.

1 comment:

  1. This is one of the highly attractive, informatics, well-written and highly crisp blog that has been explained in fabulous manner to help out reader and visitors. All information found here is genuine and realistic.
    joomla extension

    ReplyDelete

Any Questions or Suggestions ?

About

Professional & Experienced Freelance Developer From India, Technologist, Software Engineer, internet marketer and Open Sources Developer with experience in Finance, Telecoms and the Media. Contact Me for freelancing projects.

Enter your email address:

Delivered by FeedBurner