PHP compress and decompress files_PHP tutorial

WBOY
Release: 2016-07-13 17:45:06
Original
1120 people have browsed it

PHP uploads the rar compressed package and extracts it to the directory

1. Principle of uploading and decompressing with php

Ordinary upload function Upload server

rar

zip Load system components Execute decompression command Successfully decompress to directory

7z

2.The difference between several types of functions used by php to execute system commands

system() outputs and returns the last line of shell results

exec() does not output results and returns the last line of shell results

passthru() only calls the command and outputs the running results as is

new com() The system predefines the com class, and you can choose any built-in method according to your needs

3. Use php predefined com component to load the shell

$obj=new com('wscript.shell'); component that loads wscript.shell to execute dos commands

$obj->run('Content of the command to be executed');

rar decompression command: winrar x decompressed file decompression location

4. Example operation php upload and decompression case

Get the current absolute path getcwd();

Upload moved file function move_uploaded_file();

This article comes from the “r0otkit” blog

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478701.htmlTechArticlephp upload rar compressed package and decompress it to the directory 1. Principle of php upload and decompression Normal upload function upload server rar zip Load the system components and execute the decompression command to successfully decompress to the directory 7z 2.ph...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!