This article describes how PHP extracts a zip file to a specified folder. Share to everyone for your reference, as follows:
/** * Function: Unzip file in ZIP format * author:friker * date:2015-15-14 * reference:http://php.cn/manual/zh/ref.zip.php * All rights reserved:php.cn */class unzip{Public Function __construct () {//init code here ... header ("Content-type
This class implements the reference PHP manual comment/** * Function: Unzip file in ZIP format * author:friker * date:2015-15-14 * reference:http://php.net/manual/zh/ref.zip.php * All Rights reserved:[emailprotected] */class unzip{public Function __construct () {//init code here ... Heade R ("Content-type:text/html;charset=utf8"); /*** unzip the file to the spe
, garbled for (enumeration entries = ZIP.E Ntries (); Entries.hasmoreelements ();) {ZipEntry entry = (zipentry) entries.nextelement (); String zipentryname = Entry.getname (); InputStream in = Zip.getinputstream (entry); Specify the extracted folder + the name of the current zip file String Outpath = (descdir+zipentryname). Replace ("/", file.separator); Determines whether the path exists, do
Tags: top production system component Ubuntu information file system compressed file UbuntRemove directory structure plus--strip-components NSuch as: Compressed file Eg.tar file information is src/src/src/eg.txtRunning TAR-XVF Eg.tar--strip-components 1Results:src/src/eg.txtIf you run TAR-XVF Eg.tar--strip-components 3The results of the decompression are: eg.txtIn the decompression, if you want to specify the decompression directory, you can add the parameter-C target directorySuch as: If we
god!Originally I started to use the method, is the decompression under Windows, and then copied into the directory I created, so I lost a connection file (you can check it yourself)Therefore, this error occurs, and if the compressed package is copied first, there will be no loss of the soft connection file.Crossing do not believe, you can try it yourself, in the shared folder, unzip a compressed package an
Import Os,os.pathimport ZipFile def zip_dir (dirname,zipfilename): FileList = [] if Os.path.isfile (dirname): F Ilelist.append (dirname) else:for root, dirs, files in Os.walk (dirname): For name in Files: Filelist.append (Os.path.join (root, name)) ZF = ZipFile. ZipFile (Zipfilename, "w", Zipfile.zlib.DEFLATED) for tar in filelist:arcname = Tar[len (dirname):] #print Arcname zf.write (Tar,arcname) zf.close () def unzip_file (Zipfilename, Unziptodir): If not os.path.exists (Unz Ip
Atitit. Web online File Manager best practices (1)---elfinder the way to use the process. Open the Browse for server folder java. NET PHP1. Environment:: Project Java Web, need to open Browse Server folder pick file, in return ... 12. The basic functions to be implemented by the online File Manager:: Specify the start
Online
The contents of the Folder.htm form file in HTML format:
Create a folder
ASP file folder-action.asp
Name = Request ("Name")Set Fs=createobject ("Scripting.FileSystemObject")Myfolder=server.mappath ("name")If not fs.folderexists (MyFolder) ThenFs.createfolder (MyFolder)End IfIf fs.folderexists (MyFolder) Then%> Folde
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.