我正在尝试使用现有文件夹创建zip。具有子文件夹和文件的文件夹。
我正在使用代码点火器 2.1.4。为此,我尝试如下:
$this->load->library('zip');
但它正在下载空的zip文件。
$this->zip->read_dir($_SERVER['DOCUMENT_ROOT'].'/cloudsip_v2/apps/feb012016/');
ob_end_clean();
$this->zip->download('feb012016.zip');
请检查
该文件夹的许可证。
试试这个::
$name = 'mydata1.txt';
$data = 'A Data String!';
$this->zip->add_data($name, $data);
// Write the zip file to a folder on your server. Name it "my_backup.zip"
$this->zip->archive('/path/to/directory/my_backup.zip');
// Download the file to your desktop. Name it "my_backup.zip"
$this->zip->download('my_backup.zip');
这是链接