Php compressed and decompressed files

Source: Internet
Author: User
Php uploads the rar package and decompress it to the directory 1. principles of php Upload and decompression common Upload function Upload server rarzip load system components run the decompression command to decompress the package to the 7z2 directory. differences between several types of functions that php executes system commands system () outputs and returns the last shell result exe... syntaxHighlighter. all ()

 

Upload the rar package in php and decompress it to the directory.

1. Principles of php Upload and decompression

Normal Upload function Upload server

Rar

The system component is loaded by zip and decompressed to the directory.

7z

2. differences between several types of functions used to execute system commands in php

System () outputs and returns the last shell result

Exec () does not output results, returns the last line of shell results

Passthru () only calls the command and outputs the running result as is.

The new com () system predefines the com class and selects the built-in method as needed.

3. use php pre-defined com components to load shell

$ Obj = new com ('wscript. shell'); loads wscript. shell to execute the DOS command component.

$ Obj-> run ('command content to be executed ');

Rar decompression command: the decompressed position of winrar x file

4. example of php Upload and decompression operations

Get the current absolute path getcwd ();

Upload the mobile file function move_uploaded_file ();

This article is from the "r0otkit" blog

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.