.rar MIME type
RAR archivearchives
application/vnd.rarRAR archives. Registered as application/vnd.rar; older servers send application/x-rar-compressed.
| MIME type | application/vnd.rar |
|---|---|
| Extensions | .rar |
| Also seen as | application/x-rar-compressed |
| Content-Type | application/vnd.rar |
| Compress in transit? | No — already compressed |
| File signature | 52 61 72 21 1A 07 (Rar!..) |
Good to know
- Creating RAR files requires proprietary software; prefer ZIP or 7z for distribution.
Serve .rar files with the right type
The response header to send:
Content-Type: application/vnd.rar
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
application/vnd.rar rar;
AddType application/vnd.rar .rar
res.set("Content-Type", "application/vnd.rar");import mimetypes
mimetypes.add_type("application/vnd.rar", ".rar")<input type="file" accept=".rar,application/vnd.rar">
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.rar | grep -i '^content-type:' file --mime-type file.rar
Frequently asked questions
What is the MIME type for .rar files?
application/vnd.rar. You may also see application/x-rar-compressed, but application/vnd.rar is the one to send.
What Content-Type header should a .rar file be served with?
Content-Type: application/vnd.rar. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .rar?
Check its bytes rather than the extension: RAR files start with 52 61 72 21 1A 07 (Rar!..). On the command line, file --mime-type name.rar does this for you.
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options