Here I'm using PHP's own ziparchive class.
A We just need to new a Ziparchive object, then use the open method to create a zip file, and then use the AddFile method to write the file to be packaged in the zip file you just created, and it's best to
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
This paper mainly from the following several convenient to explain file archiving and compression, while comparing the compression ratios and characteristics of several different compression methods.
File Archive command tar,tar.gz source
Instance: compressing the contents of the current directory on the server as xxx.zip files
Zip-r xxx.zip./*
Unzip the zip file to the current directory
Unzip Filename.zip
============================
Another: Some servers do not
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
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
/*
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
This article mainly introduces how to compress all files in a python folder as zip files, which can be used to compress simple zip files, for more information, see the example in this article. Share it with you for your reference. The details are as
From:http://hi.baidu.com/jorling/blog/item/13db7bec1c38a1d32e2e21d3.html
File compression and archiving
Sometimes we need to store a set of files in a single file for backup or transfer to another directory or even another computer. Sometimes we
The example in this article describes how Python compresses all files in a folder to a zip file. Share to everyone for your reference. Specific as follows:
With this code can be used to package their own folder as Zip, I use this code to back up
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.