What is the MIME type of .exe files?
The MIME type (media type) for Windows executable files with the .exe extension is application/vnd.microsoft.portable-executable. You may also see application/octet-stream. Most servers send application/octet-stream, which is also fine for forcing a download.
Content-Type header
Content-Type: application/vnd.microsoft.portable-executable
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | application/vnd.microsoft.portable-executable exe; |
Apache (.htaccess) | AddType application/vnd.microsoft.portable-executable .exe |
IIS (web.config) | <mimeMap fileExtension=".exe" mimeType="application/vnd.microsoft.portable-executable" /> |
| Node.js / Express | res.type('exe') or res.setHeader('Content-Type', 'application/vnd.microsoft.portable-executable') |
| Amazon S3 | Set Content-Type: application/vnd.microsoft.portable-executable on the object (metadata), or pass --content-type application/vnd.microsoft.portable-executable to aws s3 cp |
Should .exe files be compressed?
No. Windows executable files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave application/vnd.microsoft.portable-executable out of your compression configuration.
Why the MIME type matters
Browsers decide what to do with a response — render, run, play or download — from the Content-Type header, not the file extension. With X-Content-Type-Options: nosniff, a wrong type causes stylesheets and scripts to be blocked outright. For uploads, never trust the type sent by the client; check the file’s content (its magic bytes) on the server.
Frequently asked questions
What is the MIME type for .exe?
application/vnd.microsoft.portable-executable. Alternatives seen in the wild: application/octet-stream.How do I set the Content-Type for .exe in Nginx?
application/vnd.microsoft.portable-executable exe; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.