PHP完全自学手册(珍藏版) 中文pdf扫描版下载
- <?php
- require 'zipconverter.php';
- $zip = new zipConverter();
- $zip->setRecursiveness(true); //default is false
- $zip->addFolder(
- array(
- './bank', //path of the current file //linux path
- )
- );
- $zipfile = './files.zip';
- $zip->setZipPath($zipfile); //Set your Zip Path with your Zip File's Name
- $result = $zip->createArchive();
- header('Content-Type: application/zip');
- header('Content-disposition: attachment; filename='.$zipfile);
- header('Content-Transfer-Encoding: binary');
- header('Content-Length: ' . filesize($zipfile));
- readfile($zipfile);
- @unlink($zipfile);
- ?>
转载请注明:谷谷点程序 » php打包文件夹类下载