【发布时间】:2015-02-10 21:54:39
【问题描述】:
我正在创建一个 PHP 服务,用户可以在其中使用 PHP 将外部 ZIP 文件从另一台服务器下载到服务器。下载后,我不断收到此 ZIP 错误,指出文件已损坏/多部分。事实并非如此。我无法在 linux 服务器上提取它,但是当我将它复制到我的 OSX 机器时,当我双击存档时它完美地提取,但终端 unzip 命令给出了相同的错误。我很困惑:
Archive: pdbeUpload.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
这是文件的链接 (140MB):
ftp://ftp.ebi.ac.uk/pub/databases/emdb/structures/EMD-2754/map/emd_2754.map.gz
请记住,我的目标是自动化下载过程,所以我需要了解为什么会失败。
这就是我使用 gunzip 得到的结果:
gunzip pdbeUpload.zip
gzip: pdbeUpload.zip: unknown suffix -- ignored
对于bunzip2,要完整:
bunzip2: pdbeUpload.zip is not a bzip2 file.
【问题讨论】:
-
也许可以阅读一些关于 gzip 和 zip 的区别stackoverflow.com/questions/20762094
-
不,伙计,我为什么要这样做?
-
因为知道事情很酷。菲尔·卡茨 RIP。
-
由于人们在论坛上闲逛并且不提供建设性帮助,我无法停止将头撞到墙上。显然,stackoverflow 的声誉必须与人类技能无关。