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
1192
votes
3 answers

How are zlib, gzip and zip related? What do they have in common and how are they different?

The compression algorithm used in zlib is essentially the same as that in gzip and zip. What are gzip and zip? How are they different and how are they same?
Abhishek Jain
  • 9,614
  • 5
  • 26
  • 40
849
votes
29 answers

How to create a zip archive of a directory?

How can I create a zip archive of a directory structure in Python?
Martha Yi
  • 8,633
  • 3
  • 18
  • 8
835
votes
9 answers

Unzipping files in Python

I read through the zipfile documentation, but couldn't understand how to unzip a file, only how to zip a file. How do I unzip all the contents of a zip file into the same directory?
John Howard
  • 61,037
  • 23
  • 50
  • 66
325
votes
18 answers

How can you zip or unzip from the script using ONLY Windows' built-in capabilities?

In Windows you can zip some files by right click → Send to → Compressed (zipped) folder And unzip by double clicking on the .zip file and extract the files. Is there a way to apply those abilities from a script (.bat file) without the need to…
Roee Gavirel
  • 18,955
  • 12
  • 67
  • 94
321
votes
7 answers

Create zip file and ignore directory structure

I need to create a zip file using this command: zip /dir/to/file/newZip /data/to/zip/data.txt This works, but the created zip file creates a directory structure mimicking the directory to the raw file. It is a lot of extra folders that I don't…
Jake
  • 4,134
  • 2
  • 16
  • 20
288
votes
24 answers

How to create a zip archive with PowerShell?

Is it possible to create a zip archive using PowerShell?
Valentin V
  • 24,971
  • 33
  • 103
  • 152
281
votes
8 answers

BitBucket - download source as ZIP

I know I can get the project through git clone command, but is there any way, how to download the project through the web interface from BitBucket.org? In the best way, I am looking for a way to download a project source as ZIP compress file.
user984621
  • 46,344
  • 73
  • 224
  • 412
280
votes
9 answers

What is a good Java library to zip/unzip files?

I looked at the default Zip library that comes with the JDK and the Apache compression libs and I am unhappy with them for 3 reasons: They are bloated and have bad API design. I have to write 50 lines of boiler plate byte array output, zip input,…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
266
votes
8 answers

Is there a zip-like function that pads to longest length?

Is there a built-in function that works like zip() but that will pad the results so that the length of the resultant list is the length of the longest input rather than the shortest input? >>> a = ['a1'] >>> b = ['b1', 'b2', 'b3'] >>> c = ['c1',…
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465
266
votes
1 answer

What is the difference between tar and zip?

What is the difference between tar and zip? What are the use cases for each?
mtk
  • 13,221
  • 16
  • 72
  • 112
245
votes
12 answers

Creating a ZIP archive in memory using System.IO.Compression

I'm trying to create a ZIP archive with a simple demo text file using a MemoryStream as follows: using (var memoryStream = new MemoryStream()) using (var archive = new ZipArchive(memoryStream , ZipArchiveMode.Create)) { var demoFile =…
Marius Schulz
  • 15,976
  • 12
  • 63
  • 97
241
votes
16 answers

Mac zip compress without __MACOSX folder?

When I compress files with the built in zip compressor in Mac OSX, it causes an extra folder titled "__MACOSX" to be created in the extracted zip. Can I adjust my settings to keep this folder from being created or do I need to purchase a third party…
Scott B
  • 38,833
  • 65
  • 160
  • 266
236
votes
29 answers

Fatal error: Class 'ZipArchive' not found in

I have a problem that I install 'Archive_Zip 0.1.1' on Linux server, but when I try to run the script to create the zip file it gives the fatal error Fatal error: Class ZipArchive not found in ... where I put the code $zip = new…
Parag Chaure
  • 2,883
  • 2
  • 19
  • 27
199
votes
8 answers

How do I ZIP a file in C#, using no 3rd-party APIs?

I'm pretty sure this is not a duplicate so bear with me for just a minute. How can I programatically (C#) ZIP a file (in Windows) without using any third party libraries? I need a native windows call or something like that; I really dislike the idea…
Esteban Araya
  • 29,284
  • 24
  • 107
  • 141
187
votes
6 answers

.rar, .zip files MIME Type

I'm developing a simple php upload script, and users can upload only ZIP and RAR files. What MIME types I should use to check $_FILES[x][type]? (a complete list please)
mrdaliri
  • 7,148
  • 22
  • 73
  • 107
1
2 3
99 100