问题现象
从虚拟机中拖放传输的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.
![图片[1] - centos解压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…. - 正则时光](https://www.regular.cc/wp-content/uploads/2023/11/QQ截图20231130190640.png)
原因分析
这种涉及文件传输的经常遇到传输后,文件不一致问题。可以首先查看前后文件是否一致。
linux中查看md5值
md5sum 文件路径
![图片[2] - centos解压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…. - 正则时光](https://www.regular.cc/wp-content/uploads/2023/11/image-118.png)
windows中查看md5值
#在powershell中使用管理员身份
Get-FileHash -Algorithm MD5 -Path 文件路径
![图片[3] - centos解压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…. - 正则时光](https://www.regular.cc/wp-content/uploads/2023/11/image-117.png)
解决办法
使用带有错误检查功能的传输工具(如winscp),或带有校验和功能的命令(例如 rsync
和 scp
),以确保文件传输的完整性。
![图片[4] - centos解压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…. - 正则时光](https://www.regular.cc/wp-content/uploads/2023/11/image-119-1024x121.png)
使用带有完整性校验的工具和命令传输文件后,再来检测文件md5值可以看到与原文件一致。并且此时解压成功!
![图片[5] - centos解压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…. - 正则时光](https://www.regular.cc/wp-content/uploads/2023/11/image-120.png)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END