.exe MIME type
Windows executableapps & binaries
application/vnd.microsoft.portable-executableWindows programs and libraries in Portable Executable format.
| MIME type | application/vnd.microsoft.portable-executable |
|---|---|
| Extensions | .exe, .dll |
| Also seen as | application/x-msdownload, application/x-dosexec |
| Content-Type | application/vnd.microsoft.portable-executable |
| Compress in transit? | No — already compressed |
| File signature | 4D 5A (MZ) the DOS header, which points to a PE header that says whether the file is an .exe or a .dll |
Good to know
- Apache's stock config sends
.exe,.dlland.msiasapplication/x-msdownload, andfile --mime-typereportsapplication/x-dosexec. Browsers download them all the same way. - Downloads get the Mark of the Web, so SmartScreen warns about unsigned or rarely downloaded programs. Code signing reduces the warnings; the Content-Type doesn't.
- On upload forms, check for the
MZsignature — renamingsetup.exetophoto.jpgdoesn't change its bytes.
Serve .exe files with the right type
The response header to send:
Content-Type: application/vnd.microsoft.portable-executable
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
application/vnd.microsoft.portable-executable exe dll;
AddType application/vnd.microsoft.portable-executable .exe .dll
res.set("Content-Type", "application/vnd.microsoft.portable-executable");import mimetypes
mimetypes.add_type("application/vnd.microsoft.portable-executable", ".exe")
mimetypes.add_type("application/vnd.microsoft.portable-executable", ".dll")<input type="file" accept=".exe,.dll,application/vnd.microsoft.portable-executable">
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.exe | grep -i '^content-type:' file --mime-type file.exe
Frequently asked questions
What is the MIME type for .exe files?
application/vnd.microsoft.portable-executable. You may also see application/x-msdownload, application/x-dosexec, but application/vnd.microsoft.portable-executable is the one to send. The same type covers .dll.
What Content-Type header should a .exe file be served with?
Content-Type: application/vnd.microsoft.portable-executable. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .exe?
Check its bytes rather than the extension: EXE files start with 4D 5A (MZ) — the DOS header, which points to a PE header that says whether the file is an .exe or a .dll. On the command line, file --mime-type name.exe does this for you.
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options