heres how I am doing now :
$path = "./uploads/1.txt";
$path1 = "./uploads/4.txt";
$this->zip->read_file($path);
$this->zip->read_file($path1);
$this->zip->download('files_backup.zip');
Now I want to add the files from a database query which returns the path of the files .
$data['query'] = $this->db->get_where('files', array('uid'=>$uid));
now please tell me which loop that I must use in order to call $this->zip->read_file($path);
from the results of the query mentioned above..
thanks
Edit:
foreach ($query->result() as $row)
{
echo $row->filename;
}
result
335476sfsr.txt
egyafhwe7g.txt
4566weyt36.txt
so, it just shows the files of that user ..
ok, so then just edit the given loop like so
foreach ($query->result() as $row)
{
$this->zip->read_file($row->filename);
}
$this->zip->download('files_backup.zip');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With