.zip MIME type
ZIP archivearchives
application/zipThe universal archive format.
| MIME type | application/zip |
|---|---|
| Extensions | .zip |
| Also seen as | application/x-zip-compressed |
| Content-Type | application/zip |
| Compress in transit? | No — already compressed |
| File signature | 50 4B 03 04 (PK..) the ZIP signature — this format is a ZIP archive inside |
Good to know
- Windows browsers often report ZIP uploads as
application/x-zip-compressed; accept both. - DOCX, XLSX, PPTX, EPUB, JAR and APK files are all ZIP archives, so the signature alone doesn't identify them.
- Watch for zip bombs and path traversal (
../) in entry names when extracting user uploads.
Serve .zip files with the right type
The response header to send:
Content-Type: application/zip
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
nginx (inside the types block in mime.types)
application/zip zip;
Apache (.htaccess or server config)
AddType application/zip .zip
Express
res.set("Content-Type", "application/zip");Python
import mimetypes
mimetypes.add_type("application/zip", ".zip")HTML file input
<input type="file" accept=".zip,application/zip">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.zip | grep -i '^content-type:' file --mime-type file.zip
Frequently asked questions
What is the MIME type for .zip files?
application/zip. You may also see application/x-zip-compressed, but application/zip is the one to send.
What Content-Type header should a .zip file be served with?
Content-Type: application/zip. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .zip?
Check its bytes rather than the extension: ZIP files start with 50 4B 03 04 (PK..) — the ZIP signature — this format is a ZIP archive inside. On the command line, file --mime-type name.zip does this for you.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options