Small fish to do file compression decompression, the beginning and no attention to detail, using the Java JDK Zip Operation Tool classThis causes the problem is the Chinese operation is garbled, or is broken.Check the information to know this is 1.6 of the history of the problemFortunately, open source Apache provides a support package that we can use to get it over.Here is the download linkProvide a jar pa
(the sample document it provides uses errors), it may not be possible to prevent the zip file directory traversal, and there is a domestic repair program reference this scenario.2. Vulnerability principles and risk examples2.1 Vulnerability PrincipleIn the Linux/unix system ".. /"represents the jump to the parent directory, some programs in the current working directory are processed to such as". /.. /.. /
(the sample document it provides uses errors), it may not be possible to prevent the zip file directory traversal, and there is a domestic repair program reference this scenario.2. Vulnerability principle and risk Example 2.1 vulnerability principleIn the Linux/unix system ".. /"represents the jump to the parent directory, some programs in the current working directory are processed to such as". /.. /.. /.
Goto Source Address: http://blog.csdn.net/jiangxinyu/article/details/8206395Installation (12.04 and above):Code:sudo apt-get install UnarLet's say the zip package that needs decompression is Foo.zipCode:Lsar Foo.zip #列出所有文件If the file name listed is already correctCode:Unar Foo.zip #解压所有文件If the file name listed is not correctCode:LSAR-E GB18030 Foo.zip #指定使用GB18
From a simple perspective, the zip format will be a good choice, and Python's support for the ZIP format is simple and easy to use.
1) Simple Application
If you only want to use python for compression and decompression, you don't need to repeat the document. Here we provide a simple usage for you to understand at a glance.
Import zipfile
F = zipfile.zipfile('filename.zip ', 'w', zipfile. zip_deflated)
F
course it is written io.Writer in the parameters, that is, our http.ResponseWriter
Remember to defer zipW.Close() closezip.Writer
to zip. Writing files in writer
f, err := zipW.Create(strconv.Itoa(i) + ".txt")
This method zip.Writer adds a file to the zip file, which means adding a
file with an extension of. RPM:#rpm2cpio file.rpm | Cpio-div12. Install files with the. deb Extension:#dpkg-I. File.deb13. Unzip the file with a. deb extension:#dpkg-deb-fsys-tarfile File.deb | Tar Xvf-ar PFile.deb data.tar.gz | Tar Xvzf-14. Files with a. zip extension:#unzip
In Ubuntu under the decompression of Windows compressed ZIP file, will appear extracted with Chinese file name garbled, this is because Ubuntu and Windows default encoding is different, Ubuntu under the default encoding is UTF-8, The default encoding under Windows is GBK. There are three ways to solve this problem:One, the command line specifies the decompression
This article illustrates how PHP extracts a zip file to a specified folder. Share to everyone for your reference, specific as follows:
/** * Function: Extract zip Format files * author:friker * date:2015-15-14 * reference:http://php.net/manual/zh/ref.zip.php * All Rights reserved:wujiangwei123@126.com */class unzip
attributes. For Linux, run the unzip-V command to view the details of a zip package, including the encryption algorithm .)
-Know the continuous content of a file in the compressed package (at least 12 bytes)
-Luck
Step 2-cracking
If you have discovered the internal content of the encrypted file on a website, you can
7-Zip Introduction
7-Zip is a compression software that claims to have the highest compression ratio today. It not only supports the unique 7z file format, but also supports a variety of other compression file formats, including ZIP, RAR, CAB, GZIP, BZIP2, TAR, etc. The co
can also directly read the contents of the ZIP compression package, very convenient, here the main summary of the reading and decompression process.
Unzip a package to the specified directory
The code is as follows
Copy Code
$zip = new Ziparchive;if ($zip->open (' test.zip ') = = TRUE) {$
Tags: Zip tarOne, zip compressionInstall Zip and unzip firstYum Install-y Zip/unzipzip 1.txt.zip 1.txtCompressed file 1.txt, compressed filename is called 1.txt.zip zip -r 123.
maximum compression ratio;
-N specifies the compression ratio (n is a number and 1
-V displays the progress information;
Bzip2/bunzip2 for compression/decompression
[Syntax]
Bzip2 file;
Bunzip2 file;
[Command description]
Bzip2 can usually generate files with a higher compression ratio than gzip. by default, bzip2 will delete the source files. you can use the-k parameter to retain the source files;
[Param
compression/Decompression
[Syntax]
Bzip2 file;
Bunzip2 file;
[Command description]
Bzip2 can usually generate files with a higher compression ratio than gzip. By default, bzip2 will delete the source files. You can use the-k parameter to retain the source files;
[Parameter description]
-K: Keep the source file;
-N specifies the compression ratio (n is a number a
1. Please download my prepared zip.php tool class, download and unzip, put the files inside the corresponding directory, I was placed in the virtual directory in the Include folder.
2. Add the following code to your PHP file
Copy CodeThe code is as follows:
Require_once "./include/zip.php";
$zip = new Phpzip ();
$zip-
directory information.The approximate flowchart is as follows:Program implementation:First, the front interfaceBecause it is a new business scenario, the foreground interface needs to be modified, providing a drop-down option for the business people to choose from.Need to restrict the types of files uploaded by the business people, written in the JS functionImplementation of the foreground interface:Second, the operation of the file objectAfter the u
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.