The Zip Processor PHP provides industry-standard Zip archive functionality.
It is designed to be easy to use. You can pack/unpack a file or folder
without a single line of code. If you need to create or extract Zip
files automatically, this extension is for you. Combined with Pure PHP Upload 2,
your users can upload Zip files directly! Use form fields to allow the
user to select his/her own files to be compressed in a new zip file for
direct download. You can even Zip a complete folder to, for example,
create a backup of your site.
You don't need to write any additional code or install server components; it runs on PHP 4 and PHP 5.
Zip Processor PHP 3.0 Manual
Case: Creating a Backup of Your Website
Introduction
In this tutorial we will explain how to automatically zip a folder that contains your website and offer it for download so you have a zip file for backup purposes.
How to do it
1. Define your site in Dreamweaver and
Create a new page
Define your site in Dreamweaver and choose the
option to create an PHP page, and an HTML page. We'll use the PHP page to
create the backup function and the HTML page to trigger it.
2. Create a Backup button
Open the HTML page and insert a button.
This button will trigger the backup function later. Add a link to the button
that links to your PHP page.
3. Open the PHP Page and Select The Server
Behavior
Add the Zip Processor 3.0 server behavior to
your PHP page.
4. Set the Zip Processor 3.0 Options
After selecting the Zip Processor 3.0 Server Behavior a new popup appears:
Leave the default Name that is used to identify the behavior.
Select the Folder that you want to backup as our Source.
Select the Zip action to zip the files after they are uploaded. Choose
the Filename and set it to any name you like. You can also generate a
dynamic name by pressing the lightning bolt icon.
Leave the Additional File field empty (optionally you can include an
extra file, such as a readme file). We leave the Move Files To Zip unchecked.
We check the Download Zip option to receive a zipped version of our
uploaded file. We check the Overwrite option to overwrite zip files with
the same name. If we leave this option unchecked, any new files will be added
to the already existing zip. We set the Allowed Files at All (you can
restrict the files that are to be extracted by type by using the dropdown, if
you set it to Customize… you can use the Extensions field to specify the
file type).
Press OK to apply your settings.
Note that if you checked the Download Zip option in Internet
Explorer you need to save the zip file before opening it.
5. Save and done
Save your page and upload it to your server,
and you are done! Go to your website and test it - you should be able to download
the zip.