【发布时间】:2013-04-29 07:46:54
【问题描述】:
我在 linux 中使用 ziparchive 压缩文件,但无法在 windows 中打开 默认的 zip 上传器,我怀疑它是由 addfile 期间的文件路径引起的 例如
$zip-addFile(‘/home/userName/public_html/gallery/license.txt’, ‘gallery/license.txt’);
以下链接的建议提到我可以删除本地路径(因为这不能被 windows 理解),它变成了
$zip-addFile(‘/home/userName/public_html/gallery/license.txt’, ‘license.txt’);
但是我需要维护目录结构,我应该如何解决这个问题?
【问题讨论】:
-
为什么不使用 tar。我从来没有遇到过用它创建的档案的问题。
tar -czf zippedFiles.zip /path/to/files应该可以工作。 -
@Zefiryn 有时需要 zip,可能是出于压缩目的。
标签: php ziparchive