This occurs when the zip file created under WIN is decompressed in linux, and the Chinese path and file name are garbled, so I wrote a script to convert the file name in the zip file. However, if the zip file is created in the WIN system of Japanese,
It originated in the zip created under win under Linux decompression, Chinese path and file name will be garbled, so I wrote a script to convert the code inside the zip file name. However, if it is a zip created under the Japanese, Korean, or
To use this PHP extension class, you need (PHP 5 >= 5.2.0, PECL zip >= 1.1.0), some methods require PHP 5.2.+, and php.ini configuration supports zipFor the win system, simply remove the annotation for the php_zip.dll extension, and then restart the
The following small series to show you a few PHP operation zip file instance, we can read the ZIP package in the specified file and delete the specified file in the ZIP package, the following to give a big this introduction.
Extracting files from a
1. zip file Directory Traversal introductionBecause the ZIP archive is allowed to exist in the package file ". /"string, an attacker could take advantage of multiple". /"Change the location of a file in the ZIP package when extracting, overwriting
Java implementation Zip decompression and compression is basically using the Java peptide and recursive technology, can be a single file and any Cascade folder compression and decompression, for some beginners is a good example.Zip plays archive and
1. zip file directory Traversal introductionBecause the ZIP archive is allowed to exist in the package file ". /"string, an attacker could take advantage of multiple". /"Change the location of a file in the ZIP package when extracting, overwriting
/*
PHP extracts files from zip compressed files
*/
$zip = new Ziparchive;
if ($zip->open (' jquery five screen up and down scrolling focus graph code. zip ') = = = TRUE) {//Chinese file name to use ANSI-encoded files format
PHP read the zip file (delete file, extract file, add File) instance
Extract files from a zip compressed file
Copy Code code as follows:
/*
PHP extracts files from zip compressed files
*/
$zip = new Ziparchive;
if
This article will share with you an example of how to operate a zip file in php, including extracting files from zip compressed files, deleting files from a zip compressed file, adding a file to a zip compressed file. We recommend that you have
This
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.