First Look at the demo:I'll step through the process of implementing this demo, which is to read the pictures and videos in the zip file.Demo Overall Architecture:First we prepare a few pictures and videos, then compress them into the Resource.zip file, after we have done, we set up a resource.xml file to record the resources within the compressed package
Careful research, the original use of PHP to write the decompression program efficiency than the imagination is still high many, since so good, and then optimize the use of their own backstage, although now most of the space Control Panel has compression and decompression this function, but sometimes some trouble.Do this before, no contact with the PHP compression this piece, online search some, most are PHP compression class, compression function, less than hundreds of lines, more than thousand
Finally, let me find the solution, that is, to implement this function through the PHP program execution function, because there are too many things that can solve ZIP files now (if you do not believe it, you can go to the place where you have downloaded the software to find it, so you will not be disappointed, and I will not be wrong ).The following is the original file of the program:# Upload. php Tutoria
Looking at the simple python tutorial, I learned how to back up files. Record the solution here.
Info-zip: http://www.info-zip.org/Zip.html#Downloads
The Code is as follows:
Import osimport time #1. source = ['d: \ sll ', 'd: \ download'] #2. target_dir = 'd: \ pyback \ '#3 target = target_dir + time.strftime('policy?m=d=h?m=s'{}'.zip 'print targetzip_command = "zip
Use the Ant.jar Package API for folder packaging. Directly on the code:1String zipfilename = "Test.zip";2File ZipFile =NewFile (zipfilename);3Org.apache.tools.ant.types.FileSet Fileset =NewFileset ();4Org.apache.tools.ant.Project PRJ =NewProject ();5Org.apache.tools.ant.taskdefs.Zip Zip =NewZip ();6 Zip.setproject (PRJ);7 Zip.setdestfile (ZipFile);8 Fileset.setproject (PRJ);9 fileset.setdir (file);//This is
In the enterprise development process often encounter file compression and decompression, although many popular compressed file format on the Web is RAR, but because RAR is not an open standard, so zip becomes more people's choice. If you do not want to develop yourself, you can choose Open source projects, such as SharpZipLib is a good choice.usingSystem;usingSy
You need a zip implementation when you do something before, the first thing to know is that the ant package's Zip package implements support for the Chinese pathname, and feels that the other should be the same as the zip util in the package, but it's a bit awkward to write, after all, it doesn't provide the Zipinputstream class, Therefore, we have to use getetri
Miniz-single C source file deflate/inflate compression library with zlib-compatible API, ZIP Archive reading/writing, PNG writing-Google Project hosting
Miniz. C is a lossless, high performance data compression library in a single source file that implements the zlib (RFC 1950) and deflate (RFC 1951) compressed data format specification standards. it supports
Apache Ant Download Address:
http://ant.apache.org/bindownload.cgi
Put the Lib/ant.jar into the build path of our project, only need Ant.jar. In fact, Ant's Zip API is very similar to JDK's, if it was written in JDK's API, basically, just change the top import package.
The code is as follows
Copy Code
Package common;Import Java.io.BufferedInputStream;Import Java.io.BufferedOutputStream;Import Java.io.File;Import Java.io.
No more nonsense, to put the key code for everyone, the specific code as follows:
import java.io.File; import java.io.FileOutputStream; import java.io.IOException;
Import Java.io.InputStream;
Import java.util.Enumeration;
Import Org.apache.tools.zip.ZipEntry;
Import Org.apache.tools.zip.ZipFile;
Import Org.springframework.stereotype.Service;
Import org.springframework.transaction.annotation.Transactional; /** * @date Creation Date: September 25, 2016 Morning 11:06:46 * @version 1.0 *
The linux unzip command can decompress a zip file in windows.
Unzip command
Syntax: unzip [Option] compressed file name. Zip
The meanings of each option are as follows:
-X file list: Decompress the file, but does not include t
A little Linux every day --- solve the possible zip file garbled problem in Ubuntu. decompress the zip file from Windows under Ubuntu, and the Chinese file name will be garbled. Www.2cto.com: the default encoding used by Windows and Ubuntu is different, and the
This article mainly introduces the PHP generated zip file class, example analysis of PHP operation zip file skills, very practical value, the need for friends can refer to the next
This example describes the PHP generated zip file
This article mainly introduces the function code used to decompress a zip file in php. each function code has a corresponding text comment. For more information, see decompress the zip file function in PHP, the source code is short. you need to use the ZZIPlib library extension. make sure the extension is enabled befor
This article mainly introduces the function code used to decompress a zip file in php. each function code has a corresponding text comment. For more information, see decompress the zip file function in PHP, the source code is short. you need to use the ZZIPlib library extension. make sure the extension is enabled befor
1, encountered the problem: in the For loop operation Zip file (the file name contains Chinese), the error is as follows: Exception in thread "main" Java.lang.IllegalArgumentException:MALFORMEDat java.util.zip.ZipCoder.toString (zipcoder.java:58) at Java.util.zip.ZipInputStream.readLOC (zipinputstream.java:297) at Java.util.zip.ZipInputStream.getNextEntry (zipin
Careful study of the original use of PHP to write the decompression program efficiency than the imagination is still much higher, since so good, simply optimize again after the use of their own backstage, although now most of the space Control Panel has compression and decompression this function, but after all, sometimes some trouble.
Before doing this, did not contact PHP compression this piece, online search some, most are PHP compression class, compression function, less then hundreds of li
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.