Use of zip class in CI framework

不言
Release: 2023-03-31 22:20:01
Original
2201 people have browsed it

The zip class that comes with the CI framework is simple and practical. This article will briefly talk about the use of the zip class of the ci framework. Friends who need it can refer to

The zip class that comes with the CI framework is simple and practical. This article Let’s briefly talk about the use of the zip class of the CI framework.

First you need to import the zip class:

$this->load->('zip');
Copy after login

In addition, considering the structure of CI, you also need to set up the automatic loading class and load the zip into it.
Alsocan be loaded uniformly during setting.
If you encounter this problem, it may be that the zip class is not loaded automatically.
The specific calling method is as follows:

$path = $_SERVER['DOCUMENT_ROOT'];//需要压缩的文件夹路径
$this->zip->read_dir($path,FALSE);//开始压缩指定路径的文件夹,清除里面的结构。
$this->zip->download('my_backup.zip');//下载压缩后的的文件。
Copy after login

The above is the entire content of this article. I hope it will be helpful to everyone's learning. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

SWFUpload plug-in upload file code

##

The above is the detailed content of Use of zip class in CI framework. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!