Questions tagged [zip]

ZIP is a format for compressed file archives, allowing packaging of multiple files and directories into a single file.

The specification for the standard is provided by PKWARE, a commercial company that sells compression software. There are multiple independent implementations of ZIP readers and writers, both libraries and finished programs, available on multiple platforms.

Implementations

There are implementations for handling files in ZIP format for many languages:

11022 questions
91
votes
7 answers

Unzipping files

I want to display OpenOffice files, .odt and .odp at client side using a web browser. These files are zipped files. Using Ajax, I can get these files from server but these are zipped files. I have to unzip them using JavaScript, I have tried using…
user69260
  • 1,465
  • 1
  • 12
  • 8
90
votes
12 answers

java.util.zip.ZipException: error in opening zip file

I have a Jar file, which contains other nested Jars. When I invoke the new JarFile() constructor on this file, I get an exception which says: java.util.zip.ZipException: error in opening zip file When I manually unzip the contents of this Jar file…
Sandhya Agarwal
  • 1,099
  • 3
  • 9
  • 7
87
votes
3 answers

Extracting a zipfile to memory?

How do I extract a zip to memory? My attempt (returning None on .getvalue()): from zipfile import ZipFile from StringIO import StringIO def extract_zip(input_zip): return StringIO(ZipFile(input_zip).extractall())
user1438003
  • 6,603
  • 8
  • 30
  • 36
85
votes
10 answers

Zip folder in C#

What is an example (simple code) of how to zip a folder in C#? Update: I do not see namespace ICSharpCode. I downloaded ICSharpCode.SharpZipLib.dll but I do not know where to copy that DLL file. What do I need to do to see this namespace? And do…
Marko
84
votes
10 answers

How can I list the files in a zip archive without decompressing it?

How can I get the equivalent of an ls of a .zip file (not gzip), without decompressing it, from the command shell? That is, how can I list the different files compressed within my .zip archive?
einpoklum
  • 118,144
  • 57
  • 340
  • 684
80
votes
16 answers

how to zip a folder itself using java

Suppose I have the following directory structure. D:\reports\january\ Inside january there are suppose two excel files say A.xls and B.xls. There are many places where it has been written about how to zip files using java.util.zip. But I want to…
mukund
  • 2,866
  • 5
  • 31
  • 41
80
votes
6 answers

how do I zip a whole folder tree in unix, but only certain files?

I've been stuck on a little unix command line problem. I have a website folder (4gb) I need to grab a copy of, but just the .php, .html, .js and .css files (which is only a couple hundred kb). I'm thinking ideally, there is a way to zip or tar a…
willdanceforfun
  • 11,044
  • 31
  • 82
  • 122
79
votes
7 answers

How to Zip files using JavaScript?

Is there a way to zip files using JavaScript?? For an example, like in Yahoo mail, when you chose to download all the attachments from an email, it gets zipped and downloaded in a single zip file. Is JavaScript capable of doing that? If so, please…
Isuru
  • 30,617
  • 60
  • 187
  • 303
79
votes
9 answers

How do I attach the Android Support Library source in Eclipse?

Having the source code attached to external libraries is awesome. Where do I find the source code for the v4 support package? Preferably, it would be a zip file which could be easily attached to the android-support-v4.jar in Eclipse.
Håvard Geithus
  • 5,544
  • 7
  • 36
  • 51
77
votes
9 answers

Why is *.tar.gz still much more common than *.tar.xz?

Whenever I see some source packages or binaries which are compressed with GZip I wonder if there are still reasons to favor gz over xz (excluding time travel to 2000), the savings of the LZMA compression algorithm are substantial and decompressions…
soc
  • 27,983
  • 20
  • 111
  • 215
76
votes
9 answers

Recommendations on a free library to be used for zipping files

I need to zip and password-protect a file. Is there a good (free) library for this? This needs to be opened by a third party, so the password protection needs to work with standard tools.
nearly_lunchtime
  • 12,203
  • 15
  • 37
  • 42
72
votes
14 answers

zip file and avoid directory structure

I have a Python script that zips a file (new.txt): tofile = "/root/files/result/"+file targetzipfile = new.zip # This is how I want my zip to look like zf = zipfile.ZipFile(targetzipfile, mode='w') try: #adding to archive …
user1189851
  • 4,861
  • 15
  • 47
  • 69
72
votes
13 answers

Installing PHP Zip Extension in CentOS

I'm attempting to install the PHP Zip extension in CentOS. My server does not have external internet access, so I downloaded it myself from PECL: http://pecl.php.net/package/zip. I chose 1.10.2, the latest "stable" release, and transferred it to my…
Ubunfu
  • 1,083
  • 2
  • 10
  • 21
70
votes
3 answers

Create zip file from byte[]

I am trying to create a Zip file in .NET 4.5 (System.IO.Compression) from a series of byte arrays. As an example, from an API I am using I end up with a List and each Attachment has a property called Body which is a byte[]. How can I…
Justin Helgerson
  • 24,900
  • 17
  • 97
  • 124
70
votes
4 answers

How to browse a .zip file in IntelliJ (or .jar, etc.)

I'd like to be able to "open up" (without unzipping) .zip files or .jar files in IntelliJ much like you can do in Eclipse by clicking the twisty. How do I do this with IntelliJ?
Joel
  • 2,601
  • 4
  • 33
  • 44