yii:zip

public static function exportZip( $filename, $data ) {
        header('Content-Description: File Transfer');
        header('Content-Type: application/zip');
        header('Content-Disposition: attachment; filename='.basename($zipname));
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: must-revalidate');
        header('Pragma: public');
        header('Content-Length: ' . filesize($zipname));
        ob_clean();
        flush();
        readfile($zipname);
        exit; 
    }

from:http://www.koofun.com/showcode.html?id=36446

from:http://yiibook.blogspot.com/2012/05/create-zip-file-in-yii.html

from:http://www.yiifans.com/portal.php?mod=view&aid=373

posted on 2016-05-30 17:53  阿卡贝拉  阅读(120)  评论(0)    收藏  举报