Welcome Guest, Not a member yet? Register   Sign In
Not abel to download file using zip library
#1

[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
#2

[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() .




Theme © iAndrew 2016 - Forum software by © MyBB