Online Zip Archiver

A script that generates an archive online, so that it puts the contents of a site, or a part, can help to make a backup or to create an archive for users.

If the site is under a CMS, this does not save the database, which can also be exported with a tool like PHPMyAdmin. In fact, by combining a backup of the database and an archive of all the files, you make a backup of the entire site.

The script is obviously protected by a password.
It requires PHP 5 and the zip module. You can verify the presence of available modules on the server with this command:

<?php
   foreach(get_loaded_extensions() as $ext)  print $ext."<br>";
?>

To generate the archive from a list of files, the following script is implemented:

define('ABSPATH', $_SERVER['DOCUMENT_ROOT']);    
$zip = new ZipArchive;
if($zip->open($target, ZipArchive::CREATE) === true)
{
foreach($ziplist as $file)
{
$path = ABSPATH.$file; $zip->addFile($path, $file); } } $zip->close();

The following variables are passed to the script:

Selecting files to archive is achieved from within a form, whose code is in the zip.php file.

Download the archive

License GPL 3.0.