0

我正在使用 PHP zipArchive 类解压缩文件并将它们存储在服务器上,但我有几个问题

extractTo 方法只返回真或假,我需要一个文件名和类型的列表,我可以

  • 检查它们是函数的有效文件类型
  • 将文件与数据库对象连接以进行检索

有任何想法吗?

4

2 回答 2

1

you can extend the class, adding a logging function which then passes through the params to the extractTo method...

see: http://php.net/manual/en/keyword.extends.php

于 2011-02-25T15:07:04.443 回答
0

回答我自己的完整性问题,DirectoryIterator 是最好的方法。过程是:

  • 创建临时文件夹
  • 提炼
  • 检查 DirectoryIterator 类
  • 移动到永久位置
  • 删除临时文件夹
于 2011-03-03T12:12:14.030 回答