Utilo

7Z MIME Type – Free, Online, Private

application/x-7z-compressed is the type servers use for a 7z archive. The signature is 37 7A BC AF 27 1C.

What .7z is

7z is a compressed archive with a header that can sit at the start or, when the archive was created that way, at the end. The signature is the six bytes 37 7A BC AF 27 1C. Solid compression means many files share one compression stream, which packs source code tightly and makes extracting a single file read more of the archive. The type nginx and Apache send is application/x-7z-compressed. It is not in the current IANA media-type list. There is no application/7z registration to upgrade to. Send the x- type that clients already map to a 7z handler.

Servers send application/x-7z-compressed for a 7z archive. The current IANA media-type list does not register that type. The file signature is the six bytes 37 7A BC AF 27 1C. The media type is application/x-7z-compressed. Extensions that use it on this page: .7z. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.

What sends application/x-7z-compressed

What sends application/x-7z-compressed: Send application/x-7z-compressed for a .7z download. Set a filename because the URL may be a generated id. Do not claim the file is application/zip. A ZIP tool will reject the signature. Range requests help when the header is at the end and a client wants to read it first. Content-Encoding on top of 7z rarely pays, because the archive is already compressed with LZMA or a similar method. Do not add a charset. The file on disk is still .7z. Once the response exists, a client trusts application/x-7z-compressed, not the filename. If you offer zip and 7z of the same tree, use two URLs. 7z will be smaller on source and slower to create. The type on each URL stays constant. Switching a stable URL from application/zip to application/x-7z-compressed without changing the path replaces a cache entry with a file old clients cannot open.

Content-Type for .7z

Send application/x-7z-compressed and do not add a charset parameter. The body is binary. A charset tells a text decoder to reinterpret bytes that are not text, which corrupts a download and does not help a browser sniff the format.

Content-TypeContent-Type: application/x-7z-compressed

nginx, Apache, and Express

These snippets map .7z to application/x-7z-compressed. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .7z so a stale mime database in the framework cannot disagree with the type on this page.

nginx# /etc/nginx/mime.types, inside the types { } block
application/x-7z-compressed  7z;
ApacheAddType application/x-7z-compressed .7z
Expressimport express from "express";

const app = express();
app.use(express.static("public", {
  setHeaders(res, filePath) {
    if (filePath.endsWith(".7z")) {
      res.setHeader("Content-Type", "application/x-7z-compressed");
    }
  },
}));

Pitfalls for application/x-7z-compressed

Pitfalls that show up for application/x-7z-compressed, and not for a neighboring type with a similar extension: A solid archive plus a client that extracts one file by reading everything is a performance surprise, not a type bug. Document it if you ship huge solid archives. Another trap is a password-protected header, which hides the file list. The type stays the same and a client cannot show a preview. Another is a partial upload that has the signature and a truncated stream. Check the size you were promised. Another is an old server that has no 7z mapping and sends application/octet-stream. Browsers download it. A desktop association may not. Add the mapping.

  • application/x-7z-compressed is the de facto type. It is not in the current IANA list.
  • The signature is six bytes, 37 7A BC AF 27 1C, not the ASCII string 7z.
  • LZMA by itself, without a 7z container, is a different stream and should not use this type.
  • Do not label a ZIP or an XZ file as 7z because the download button said 7z.

Frequently asked questions

Is this type registered?

Not in the current IANA media-type list. application/x-7z-compressed is what servers and 7z clients use.

What is the signature?

37 7A BC AF 27 1C.

Can I send application/zip instead?

No. The formats are different. A ZIP reader cannot unpack 7z.

Does solid compression change the type?

No. Solid mode is an encoder setting. The type stays application/x-7z-compressed.