Codeigniter使用现有文件夹创建zip文件并下载。

I am trying to create zip with existing folder. That folder having sub folders and files.
I am using codeigniter 2.1.4. For this i tried as below:

$this->load->library('zip');
$this->zip->read_dir($_SERVER['DOCUMENT_ROOT'].'/cloudsip_v2/apps/feb012016/'); ob_end_clean(); $this->zip->download('feb012016.zip');


But its downloading empty zip file.

try this ::

$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'); 

here is link

Please check permits for that folder.