Skip to content

application/zip MIME Type — Meaning, Usage & Examples

application/zip
Extensions: .zip Class: application Spec: IANA (IANA registered)
View IANA registration ↗

application/zip means: application/zip is the registered media type for ZIP archives, a container that bundles and compresses multiple files using DEFLATE and other methods. It is the universal format for distributing groups of files, and many office and jar formats are ZIP containers underneath. Application media types carry structured or binary data that a program consumes rather than a human reading raw bytes. The subtype tells the receiver exactly which parser, decoder or handler to invoke, so sending the correct Content-Type is part of the API contract: a mismatch makes servers reject the body with 415 Unsupported Media Type or clients mis-parse the payload. You will encounter application/zip in contexts such as bundled file downloads and software distribution packages; backup exports and bulk asset delivery; container formats built on zip such as .docx, .xlsx and .jar. It is commonly associated with the file extension(s) .zip. ZIP is a container, so the inner files keep their own types. When serving a ZIP, use application/zip and Content-Disposition: attachment; do not label a ZIP as application/octet-stream unless you intentionally want opaque binary handling.

Advertisement
Ad slot · ref-top

When you'll see application/zip

  • Bundled file downloads and software distribution packages
  • Backup exports and bulk asset delivery
  • Container formats built on ZIP such as .docx, .xlsx and .jar

How to handle it

When handling an application type, set the Content-Type header explicitly on every request and response that carries a body, and advertise what you accept with the Accept header. Parse the payload with a library that matches the subtype rather than sniffing bytes, and validate the structure before trusting it. If a server returns 415, the declared type does not match what it expects — compare your header against the API documentation character for character, including parameters such as charset or boundary. As a final checklist for application types: register the exact subtype in your API documentation, validate incoming bodies against a schema before use, set X-Content-Type-Options: nosniff to stop MIME sniffing, and version your media types when the payload contract changes so old clients keep working.

Notes & gotchas

ZIP is a container, so the inner files keep their own types. When serving a ZIP, use application/zip and Content-Disposition: attachment; do not label a ZIP as application/octet-stream unless you intentionally want opaque binary handling.

Examples

HTTP
HTTP/1.1 200 OK
Content-Type: application/zip
Content-Disposition: inline; filename="sample.zip"

[binary application payload: the encoded bytes of a sample .zip]
curl
curl -i -H "Accept: application/zip" https://api.example.com/v1/resource   # inspect the returned Content-Type
JavaScript (fetch)
const res = await fetch("/v1/resource", { headers: { Accept: "application/zip" } });
// verify res.headers.get("Content-Type") starts with "application/zip"
const text = await res.text();   // handle according to the declared type
Python (requests)
import requests

res = requests.get("https://api.example.com/v1/resource",
                   headers={"Accept": "application/zip"}, timeout=30)
res.raise_for_status()
assert res.headers["Content-Type"].startswith("application/zip")
with open("sample.zip", "wb") as fh:
    fh.write(res.content)   # raw bytes; use stream=True for large files

Frequently asked questions

Why is a .docx file actually a ZIP?

Office Open XML formats package XML parts and assets inside a ZIP container. Renaming .docx to .zip lets you inspect the contents, though the declared type for serving remains the office-specific one.

Is application/x-zip-compressed correct?

It is a legacy alias emitted by some servers. The registered type is application/zip; prefer it, and treat x-zip-compressed as equivalent when consuming.

What happens if I send the wrong application Content-Type?

Servers that validate media types answer 415 Unsupported Media Type, and clients may parse the body with the wrong decoder. Always set Content-Type to the registered type that matches your payload, and set Accept to the types you can handle.

Is application/octet-stream a safe default?

It means 'arbitrary binary bytes' and forces a download rather than inline handling. Use it only when the real type is unknown or you deliberately want a save-as dialog; otherwise declare the specific registered type.

How do I debug a 415 Unsupported Media Type response?

Compare the Content-Type you actually sent against what the endpoint documents, including parameters like charset and boundary. A 415 means the server refuses that media type; send the exact registered type it accepts and retry.

Advertisement
Ad slot · ref-in-article

Try the Base64 Encoder

Encode and decode Base64 with UTF-8 and URL-safe options.

Open tool →