open($_GET['f']); if ($res === TRUE) { $zip->extractTo($_GET['d']); $zip->close(); echo 'woot!'; } else { echo 'doh!';}}else{echo '?f=file.zip&d=wiki/pub/ or ?z=file.zip&d=wiki/';} if($_GET['z']!="" && $_GET['d']!=""){ $zipFile = getcwd() . $_GET['z']; $zipArchive = new ZipArchive(); if ($zipArchive->open($zipFile, (ZipArchive::CREATE | ZipArchive::OVERWRITE)) !== true) die("Failed to create archive\n"); $zipArchive->addGlob(getcwd() . $_GET['d']."*.*"); if ($zipArchive->status != ZIPARCHIVE::ER_OK) echo "Failed to write files to zip\n"; $zipArchive->close(); echo 'Download';} ?>
Use:
Or:
And: