downloading multiple files by adding them to a zip

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

downloading multiple files by adding them to a zip

Post by Burrito »

I have a select box that allows multple selects of file names. When that form is submitted, I'd like to zip up all of the files selected and then have it download to the end user.

The part I'm having trouble with is creating this zip file. I looked here:

http://www.zend.com/zend/spotlight/crea ... files1.php but that didn't provide enough info for me.

can anyone shed some light or perhaps share some code?

thx,

burr
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

The easy way, is to use the PHP function gzcompress: http://ca2.php.net/manual/en/function.gzcompress.php

I believe, gzip is essentially the same as .zip files and all windows users will be able to read them.

Now this is the super lazy fast way :)
Post Reply