【问题标题】:how to get only folder name when extract the zip file in code igniter在codeigniter中提取zip文件时如何仅获取文件夹名称
【发布时间】:2018-03-19 05:40:47
【问题描述】:

我正在使用 zip 库来压缩文件夹或目录

我的路径结构是

   $estructure = "/home/administrator/Downloads/pdf_files/" 

然后使用下面的代码压缩文件夹

   $this->zip->read_dir($estructure);
   $this->zip->archive('/var/www/');
   $this->zip->download('folder_name.zip');

现在的问题是当我提取压缩目录时,它会给出完整路径

  /home/administrator/Downloads/pdf_files/

我需要的是当我提取 zip 文件时,它应该只是像 pdf_file 这样的目录,

请问有什么可以帮助我的吗?谢谢

【问题讨论】:

  • 你用什么代码来解压文件?
  • 我不是用代码解压,用的是Archive mounter软件。

标签: php codeigniter directory zip


【解决方案1】:

好的,我有答案了

  $this->zip->read_dir($estructure,FALSE);
  ob_end_clean();

它现在工作正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多