[英]ZipArchive in PHP7 cannot find content of zip
I have a PHP script to unzip a zip file from a form, but whatever content i put in the zip, the opened zip cannot find the items. 我有一个PHP脚本可以从表单中解压缩zip文件,但是无论我放入zip的内容如何,打开的zip都找不到项目。 When I
var_dump()
my zip I get this: 当我用
var_dump()
压缩时,我得到以下信息:
object(ZipArchive)#800 (5) {
["status"]=> int(0) ["statusSys"]=> int(0)
["numFiles"]=> int(0)
["filename"]=> string(14) "/tmp/php83KJHe"
["comment"]=> string(0) ""
}
here is the script: 这是脚本:
$zip = new \ZipArchive();
$zipname = $_FILES[ 'lezip' ][ 'tmp_name' ];
$zip->open( $zipname, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE );
var_dump( $zip );
$zipsuccess = $zip->extractTo( $destination );
var_dump( ' success: ' . $zipsuccess );
the success dump says it is ok 成功转储说没关系
string(11) " success: 1"
And i did set up the $destination folder, it exists and have write access. 而且我确实设置了$ destination文件夹,该文件夹存在并且具有写访问权。
Why can't ZipArchive find any items to the zips i upload ? 为什么ZipArchive找不到我上传的zip的任何项目?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.