CodeIgniter Forums
Not abel to download file using zip library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Not abel to download file using zip library (/showthread.php?tid=21151)



Not abel to download file using zip library - El Forum - 08-01-2009

[eluser]nandish[/eluser]
Hi guys

<?php
class CTest extends Controller {

function __Construct() {

parent::Controller();
$this->load->library('zip');

}

function index() {
$path = base_url()."book_files/fs1393.pdf";
$this->zip->read_dir($path);
// Download the file to your desktop. Name it "my_backup.zip"
$this->zip->download('my_backup.zip');

}
}
?>

am not getting any error but Its not downloading

i can able to download file using helper file (download) but it wont give in zip


Thanks in advance


Not abel to download file using zip library - El Forum - 08-01-2009

[eluser]pistolPete[/eluser]
Did you enable error logging / displaying?
From the user guide libraries/zip.html:
Quote:$this->zip->read_dir()
Permits you to compress a folder (and its contents) that already exists somewhere on your server.
You should use $this->zip->read_file() .