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 file option 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.
-
Bin
-
Bin
-
http://www.programmingfacts.com/ Rakshit Patel
-
http://www.programmingfacts.com/ Rakshit Patel
-
Rajesh Bakade65



I am