/* Link from: http://www.ibm.com/developerworks/cn/opensource/os-php-v524/
* Author profile: Tracy Peterson (tracy@tracypeterson.com), freelance writer, Consultant. From
* Since 1997, Tracy Peterson has been an IT project manager and Web developer.
*
Compression (zip), compression zip
By default, these compression tools will delete the source files (except zip files) after compression. By default, only files are compressed, but directories are not compressed (LinkPackage).
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
Copy CodeThe code is as follows:
Class zip
{
var $datasec, $ctrl _dir = Array ();
var $eof _ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
var $old _offset = 0; var $dirs = Array (".");
function get_list ($zip _name)
{
$zip = @fopen ($zip _name, '
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
: This article describes how to compress and decompress a Zip file using PHPZipArchive. For more information about PHP tutorials, see.
PHP ZipArchive is a PHP Extension class that can easily compress and decompress ZIP files. before using it,
PHP ziparchive is a PHP extension class, you can easily achieve the zip file compression and decompression, before using the first to ensure that the PHP zip extension has been opened, the specific opening method does not say, different platforms to
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
Released on: 12/13/2004 | updated on: 12/13/2004
Ianier Munoz
This document assumes that you are familiar with C # And Windows Forms.
Download the code in this article:Zipcompression.exe(150kb)
Summary
When you store files or send files over the
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.