public function download(){
$this->load->library('zip');
$path = './application';
$this->zip->read_dir($path);
$this->zip->download('VSSS.zip');
}
It downloading ZIP but inside ZIP there is no content. ZIP size is almost 800 kb but inside ZIP there is no content. How can I resolve this issue?
Try alternative way
$path = './application';
$file_name = 'VSSS.zip';
force_download($path.'/'.$file_name, NULL);
read more about codeigniter force_download
https://www.codeigniter.com/userguide3/helpers/download_helper.html
对于仍在解决此问题的人,只需从路径开头删除"/"
或"./"
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.