Copy the Code code as follows:
/*********************** @file-path to zip file* @destination-destination directory for unzipped files*/function Unzip_file ($file, $destination) {Create Object$zip = new Ziparchive ();Open Archiveif ($zip->open ($file)!== TRUE) {Die (' Could not open archive ');}Extract contents to destination directory$zip->extractto ($destination);Close Archive$zip->close ();Echo ' Archive extracted to directory ';}
PHP zip compres
Original: http://www.linuxdiyf.com/viewarticle.php?id=193969
Note: Just want to know how to extract the RAR format friends can jump directly to the back, but note to install the 7zip rar module another: Linux can also be installed Unrar to extract RAR files, here Conlio Brie
Huawei Software Park: http://www.onlinedown.net/soft/3.htm
Rarlinux Official Website: http://www.rarsoft.com/download.htm tar-zxvf rarlinux-3.8.0.tar.gz // extract tar.gz files first
Cd rar // directly CD to the corresponding folder
Su root // use root permission
Make // If the prompt is that the permission is insufficient, Su root will obtain the highest permission
Make install congratulations on your inst
Under the Windows platform compressed into the RAR file, how to decompress under the Linux platform, Linux platform by default is not supported by RAR file decompression, need to install the Linux version of RAR compression software, for:/http Www.rarlab.com/download.htm Currently the latest version is 5.3. After the download, after the decompression, into the
1, first of all, we first say why there are three formats:(1) RAR format: RAR format is the first compression method, it is mainly used for the compression of some files of commercial organizations, it can be based on the requirements of different companies, to set up different compression algorithms, this algorithm is not public, security is relatively high, but he is charged.(2) Zip format: Because of the
= processwindowstyle. hidden; the_startinfo.workingdirectory = rarpatch; // obtain the path of the compressed package.
process the_process = new process (); the_process.startinfo = the_startinfo; the_process.start (); the_process.waitforexit (); the_process.close (); }{}}
RAR parameters:1. Compression commands1. Compress temp.txt to temp.rar rar a temp.rar temp.txt2. compress all files in the curren
One is to install UnrarThe second is the following talk of the transfer from the networkFedora does not support RAR files by default, then you must install the relevant software if you want to open the RAR file.Download rar 3.71 for Linux this file:http://www.rarlab.com/rar/rarlinux-3.7.1.tar.gzFile size 759K, uncompre
Compression | Have you ever thought about extracting compressed files online? Oh, sometimes upload a compressed package, the use of ASP program decompression is indeed very convenient, especially the webmaster who often update the site, because the text file compression ratio is large, so the use of compression after the upload and then decompression, so more than direct upload to save a lot of valuable time. You ready? Let's keep it up.
In order to achieve this function, first of all to get a
Compression | Have you ever thought about extracting compressed files online? Oh, sometimes upload a compressed package, the use of ASP program decompression is indeed very convenient, especially the webmaster who often update the site, because the text file compression ratio is large, so the use of compression after the upload and then decompression, so more than direct upload to save a lot of valuable time. You ready? Let's keep it up.
In order to achieve this function, first of all to get a
Generally through the default installation of Ubuntu can not extract RAR files, only after the installation of RAR decompression tool, can be decompressed. In fact, the installation of RAR decompression tool under Ubuntu is very simple, only need two steps can be quickly done.Ubuntu
For the zip file on the web, a lot of examples, RAR file decompression PHP does not have direct support, you can use PECL to Http://pecl.php.net/package/rar download the corresponding version of the non-thread-safe DLL and then throw to the PHP ext directory.
Open php.ini.
Add one line
Extension=php_rar.dll
Restart the Web server and PHP
Copy Code code as follows:
Public function _unzip
extracting servic E-worker.js OK extracting main.dc903dc2.css OK extracting main.7 B35a52f.js OK extracting Iconfont.715ffea7.ttf OK extracting iconfont.79c4ad9a.eot OK extracting iconfont.f8b575df.svg OK all ok[[emailprotected] test]# ls-ltotal 1468-rw-r--r--1 root root 352 June 4 10: asset-manifest.json-rw-r--r--1 root root 283518 June 4 10:09 build.rar-rw-r--r--1 root root 146 June
extracted filesN[Email protected] Read additional filter Masks from stdin[Email protected]o[+|-] Set the overwrite modeOl[a] Process Symbolic Links as the link [absolute paths]or Rename files automaticallyow Save or restore file owner and groupP[password] Set PasswordP-do not query passwordR Recurse SubdirectoriesScSlsmtatbtnToTsU Update FilesV List all volumesVer[n] File version controlVP Pause before each volumex[Email protected] Read file names to exclude from stdin[Email protected]Y assume
Extract the rar compressed package in Linux, and use linuxrar
First download winrar for Linux: http://www.rarlab.com/download.htm at this URL
Extract the rar folder and enter the rar folder in the terminal,
Run the make command,
Then you can decompress the package.
Friends give me a support for ASP space, but upload files can only be a single file upload, no batch upload, my page has a lot of
Small pictures, this way of uploading is very painful. So consider the picture file can be compressed into a RAR format, and then on the server solution
Pressure.
In fact, want to achieve this function is very simple, first of all to upload a RAR decompression program, is
Server | Server actually want to achieve this function is very simple, first of all to upload a RAR decompression program, is RAR own decompression program, only need its core
Program RAR.EXE this file is OK. Then you will upload a program that executes RAR.EXE CMD. EXE This is a program in Windows (don't need me to say it). Finally, we started to implement these procedures. Take a look at the following cod
In fact, want to achieve this function is very simple, first of all to upload a RAR decompression program, is RAR own decompression program, only need its core
Program RAR.EXE this file is OK. Then you will upload a program that executes RAR.EXE CMD. EXE This is a program in Windows (don't need me to say it). Finally, we started to implement these procedures. Take a look at the following code
Dim Ylj,yw
TAR-XVF rarlinux-3.9.3.tar.gzCD rarMakeSee the following message that the installation was successful.Mkdir-p/usr/local/binMkdir-p/usr/local/libCP rar Unrar/usr/local/binCP Rarfiles.lst/etcCP Default.sfx/usr/local/libThe following issue occurs when you run the command rarRAR:/lib/i686/nosegneg/libc.so.6:version ' glibc_2.7 ' not found (required by RAR)Workaround:CP Rar_static/usr/local/bin/rarRAR x Vpsyou.r
WinRAR can contain annotation information when making a compressed file. When you download the RAR compressed files from the Internet, when the decompression operation, or run the files contained therein, it is best to pay attention to the annotation information, may be included in the annotation information such as registration code, the use of the method and other important content.
If the compression package is more, look at the annotation
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.