background image

 

$tmpManager

->DeleteDir(

$curtempdir

); 

//删除旧的文件夹

}

if

 (sizeof(

$tempfolder

) > 0 || sizeof(

$tempfile

) > 0) {

mkdir

(

$curtempdir

, 0777); 

//如果有要打包的文件货文件夹,重新创建文件夹

}

if

 (sizeof(

$tempfile

) > 0) {

$tmpManager

->CopyFile(

$tempfile

,

$curtempdir

); 

//将要下载的文件 copy 到创建的文件夹

}

if

 (sizeof(

$tempfolder

) > 0) {

$tmpManager

->CopyFolder(

$tempfolder

,

$curtempdir

); 

//将要下载的文件夹 copy 到创建的文

件夹

}

$zip

 = 

new

 PHPZip();

$zip

 -> downloadZip(

$curtempdir

, “file_”.

date

(‘Ymd’).”.zip”);

//打包并下载

压缩类:
<?php

/*
File name: /include/zip.php
Author: Horace 2009/04/15
*/