|
...
|
...
|
@@ -15,7 +15,10 @@ class Template extends Common{ |
|
|
|
}
|
|
|
|
|
|
|
|
public function index(){
|
|
|
|
//$path = $this->publicpath.'images/'.input('folder').'/'; ///Applications/XAMPP/xamppfiles/htdocs/dashboard/images/
|
|
|
|
//$path = $this->publicpath.'images/'.input('folder').'/';
|
|
|
|
//
|
|
|
|
//测试环境 /Applications/XAMPP/xamppfiles/htdocs/dashboard/images/
|
|
|
|
//线上环境 /alidata/www/dc-api/public/tables/batchPicsyn/
|
|
|
|
|
|
|
|
$path = "/alidata/www/dc-api/public/tables/batchPicsyn/";
|
|
|
|
|
|
...
|
...
|
@@ -64,8 +67,9 @@ class Template extends Common{ |
|
|
|
|
|
|
|
//新建zip压缩包
|
|
|
|
$obj = $zip->open($filename,\ZIPARCHIVE::OVERWRITE | \ZIPARCHIVE::CREATE);
|
|
|
|
$newfile = trim(strrchr($file, '/'),'/');
|
|
|
|
//把图片一张一张加进去压缩
|
|
|
|
$zip->addFile($file);
|
|
|
|
$zip->addFile($file,'/download/'.$newfile);
|
|
|
|
//打包zip
|
|
|
|
$rs = $zip->close();
|
|
|
|
}else{
|
|
...
|
...
|
@@ -78,7 +82,8 @@ class Template extends Common{ |
|
|
|
//把图片一张一张加进去压缩
|
|
|
|
$files = glob($file.'/*');
|
|
|
|
foreach($files as $key=>$val){
|
|
|
|
$zip->addFile($val);
|
|
|
|
$newfile = trim(strrchr($val, '/'),'/');
|
|
|
|
$zip->addFile($val,'/download/'.$newfile);
|
|
|
|
}
|
|
|
|
|
|
|
|
//打包zip
|
...
|
...
|
|