Home > Backend Development > PHP Tutorial > qq邮箱中转站zip rar压缩文件预览用php是如何实现的

qq邮箱中转站zip rar压缩文件预览用php是如何实现的

WBOY
Release: 2016-06-13 13:13:34
Original
1834 people have browsed it

qq邮箱中转站zip rar压缩文件预览用php是怎么实现的?
太强大的功能了,非常适合我,但是不知道怎么实现 呢

------解决方案--------------------

$zip = zip_open("你的zip文件,注意路径,如C:\AppServ\www/myzip.zip");

if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "Name: " . zip_entry_name($zip_entry) . "\n";
echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "\n";
echo "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "\n";
echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "\n";

if (zip_entry_open($zip, $zip_entry, "r")) {
echo "File Contents:\n";
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
echo "$buf\n";

zip_entry_close($zip_entry);
}
echo "\n";

}

zip_close($zip);

}
?> 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template