2009年5月9日

PHP HTTP_Download on-the-fly generated archives

PEAR - PHP Extension and Application Repository
HTTP_Download
Archive_Zip

//-- download.php --
<?php
require_once('File/Find.php');
$finder = new File_Find();
$files = $finder->search('/*', '.', '*', false, 'files');

require_once('HTTP/Download.php');
$name = 'backup_' . date('m-d-y_H:m:s') . '.zip';
$dl = &new HTTP_Download();
$dl->sendArchive($name, $files, HTTP_DOWNLOAD_ZIP);
?>

沒有留言:

網誌存檔