devkult_
tools29converters34

.7z MIME type

7-Zip archivearchives

application/x-7z-compressed

7-Zip archives with high compression ratios.

MIME typeapplication/x-7z-compressed
Extensions.7z
Content-Typeapplication/x-7z-compressed
Compress in transit?No — already compressed
File signature37 7A BC AF 27 1C (7z¼¯'.)

Good to know

  • Not natively supported by older Windows or macOS versions; ZIP is the safer choice for downloads aimed at everyone.

Serve .7z files with the right type

The response header to send:

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

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/x-7z-compressed 7z;
Apache (.htaccess or server config)
AddType application/x-7z-compressed .7z
Express
res.set("Content-Type", "application/x-7z-compressed");
Python
import mimetypes

mimetypes.add_type("application/x-7z-compressed", ".7z")
HTML file input
<input type="file" accept=".7z,application/x-7z-compressed">

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.7z | grep -i '^content-type:'
file --mime-type file.7z

Frequently asked questions

What is the MIME type for .7z files?

application/x-7z-compressed.

What Content-Type header should a .7z file be served with?

Content-Type: application/x-7z-compressed. It's already compressed, so servers shouldn't gzip it.

How can I tell if a file is really a .7z?

Check its bytes rather than the extension: 7Z files start with 37 7A BC AF 27 1C. On the command line, file --mime-type name.7z does this for you.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options