Zip-It! quite simply, is a component that automatically zips up files & folders you'd like, into a zip file.
Upon making a request to add files and folders to a zip, it first of all quickly and intelligently verifies that these files and folders exist. Once done with the verification, it will then create (or overwrite) a zip file and add all of these files, folders (and sub-folders and files recursively within them), into the zip. Upon completion, it can then provide a download link to the user, which when clicked on starts a header based download, so they may begin downloading the zip.
Zip-It! is the perfect solution for packing files on the fly and providing a download option to the user if you wish.
Installation of Zip-It! couldn't be simpler;
Copy zip-it.php, zip-it-download-zip.php and zip-it.css to your website.
Create a new folder, called zips and change the write permissions on this folder to allow the public to write to it (most commonly referred to as changing the CHMOD permissions to allow public write access).
Set a HTML form to send form fields to zip-it.php via a POST form sending method, ensuring that the field name begins with _zipIt and the value of that field contains the filename or folder that you wish to include in the zip. Please ensure you end folders with a trailing to indicate it's a folder and not a file.
form action="zip-it.php" method="POST" input type="hidden" name="zipItFile1" value="images/Birds.jpg" input type="hidden" name="zipItFile2" value="images/Castles.jpg" input type="hidden" name="_zipItFile3" value="trips/" input type="submit" name="submit" value="Zip It!" /form
That's it! When you click the button, your specified files will be packed up into a zip and a download link provided. Clicking this will then prompt a download in your web browser.
Note: Should you run into any problems, please check to ensure you have the php_zip extension enabled.95