Zip Component in CakePHP-Add files in Zip

cakephp-freelancer-developer

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.

About Rakshit Patel
I am PHP Freelancer, Rakshit Patel AKA WordPress Freelancer working as PHP Programmer India. I am here to share all my developing knowledge, quick coding techniques, quick solutions to save your time and help you guys for any issue or bug fixing. If you have any PHP, WordPress, Magento related work, please contact me. I am interested for the work.

15 Comments on Zip Component in CakePHP-Add files in Zip

  • Rakshit Patel
    June 4, 2010 at 5:30 am

    I did not find any Zip Component of CakePHP at given url.

  • Rakshit Patel
    June 4, 2010 at 11:00 am

    I did not find any Zip Component of CakePHP at given url.

  • Rajesh Bakade65
    August 30, 2010 at 10:51 am

    Its Good
    Thanks……

  • guest
    September 9, 2010 at 5:21 am

    Thanks for the post . it was helpful, but when i tried to zip files with large size got the error ” Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 42299447 bytes) ”
    Hoping for a good answer

  • google.com
    January 8, 2014 at 6:13 am

    I do not know whether it’s just me or if perhaps everyone else experiencing issues
    with your site. It appears as though some of the written text in
    your content are running off the screen. Can somebody else
    please provide feedback and let me know if this is happening to them as
    well? This could be a issue with my web browser because I’ve had this happen before.

    Many thanks

  • free cccam server 2014
    May 3, 2014 at 7:13 pm

    Thanks , I’ve just been looking for info about this topic for a long time and yours is the best I have discovered till now.

    However, what concerning the conclusion? Are you
    positive concerning the source?

  • Http://Aspergersyndrometest.Jigsy.Com/
    June 20, 2014 at 8:58 pm

    Hey there! I’ve been following your site for some
    time now and finally got the courage to go ahead and give you a shout out from Porter Texas!
    Just wanted to tell you keep up the fantastic work!

  • palms @ sixth avenue
    July 4, 2014 at 3:03 am

    Normally I don’t learn article on blogs, but I wish to say that this write-up very pressured me to take a look at
    and do so! Your writing style has been amazed me. Thanks, quite great article.

  • tattoo ambigram
    September 27, 2014 at 10:01 pm

    I read this article fully about the resemblance of most recent and
    previous technologies, it’s awesome article.

  • webpage
    October 15, 2014 at 6:57 am

    After checking out a few of the blog posts on your blog, I
    honestly like your technique of writing a blog. I saved it to my bookmark
    site list and will be checking back soon.

  • superuser
    February 11, 2015 at 7:30 pm

    Your style is really unique in comparison to other folks I have read stuff from.
    Thank you for posting when you have the opportunity, Guess I’ll just book mark this web
    site.

Leave a Reply

Your email address will not be published. Required fields are marked *

Sponsors

Sponsors

Recommended

DHgate Computers
DHgate.com - Computers, Cell Phones & more
  • We find everbuying built in php and use css to control the style.

About Author

PHP Freelancer

PHP Freelancer I am PHP Freelancer, Rakshit Patel working as PHP Programmer India. I am here to share all my developing knowledge with you people. For Hire PHP Developer India, contact me.
Follow on twitter: @raxit4u2

Get Free Programming Tutorials:

Become a Fan

Popular Topics

Recent Posts

Most Popular

Recent Comments

Get a Free Quote
$
$
$
Security Question: 3 + 8 = ?
$
 
Listing all pages