http://blog.hsin.tw/2008/php-pclzip/
//zip儲存在uploads
include_once("pclzip.lib.php");
$download_file = "../../uploads/{$_REQUEST['act_sn']}.zip";
$archive = new PclZip($download_file);
$v_list = $archive->create("../../uploads/{$_REQUEST['act_sn']}",PCLZIP_OPT_REMOVE_PATH,"../../uploads");
if ($v_list == 0) {
die("Error : ".$archive->errorInfo(true));
}
header('Content-type:application/force-download');
header('Content-Transfer-Encoding: Binary');
header('Content-Disposition:attachment;filename="'.$_REQUEST['act_sn'].'.zip" ;');
readfile($download_file);
沒有留言:
張貼留言