【发布时间】:2017-01-06 10:33:40
【问题描述】:
我正在为网站使用 codeigniter 框架。我需要从特定目录下载所有文件。我可以单独使用 PHP 来完成这项任务,但不能在 codeigniter 中工作可能是由于某些路径问题。我在许多网站上搜索但无法获得正确的解决方案。此外,在此处遵循官方文档:codeigniter zip documentation,但没有任何成功。我需要工作代码,可以直接测试。 我现在拥有的代码是:
$path = '/path/to/your/directory/';
$this->zip->read_dir($path);
// Download the file to your desktop. Name it "my_backup.zip"
$this->zip->download('my_backup.zip');
【问题讨论】:
-
有人知道答案吗?我卡在了这一点上。
-
你想从文件夹下载 zip 文件
-
@KumarRakesh 我想下载整个文件夹。
-
尝试在开头不使用斜线:
path/to/your/directory,以防文档根目录中的path文件夹(相对于 index.php)
标签: php codeigniter