Welchen MIME-Typ haben .exe-Dateien?
Der MIME-Typ (Medientyp) für Windows-Programme mit der Endung .exe lautet application/vnd.microsoft.portable-executable. Manchmal siehst du auch application/octet-stream. Die meisten Server senden application/octet-stream, was ebenfalls passt, um einen Download zu erzwingen.
Content-Type-Header
Content-Type: application/vnd.microsoft.portable-executable
Server-Konfiguration
| Server | Konfiguration |
|---|---|
Nginx (mime.types oder 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') oder res.setHeader('Content-Type', 'application/vnd.microsoft.portable-executable') |
| Amazon S3 | Setze Content-Type: application/vnd.microsoft.portable-executable am Objekt (Metadaten) oder übergib --content-type application/vnd.microsoft.portable-executable an aws s3 cp |
Sollten .exe-Dateien komprimiert werden?
Nein. Windows-Programme sind intern bereits komprimiert. gzip oder Brotli würden daher nur unnötig CPU kosten und die Größe kaum verringern, manchmal sogar vergrößern. Lass application/vnd.microsoft.portable-executable aus deiner Komprimierungskonfiguration heraus.
Warum der MIME-Typ wichtig ist
Browser entscheiden anhand des Content-Type-Headers, nicht anhand der Dateiendung, was mit einer Antwort passiert: anzeigen, ausführen, abspielen oder herunterladen. Mit X-Content-Type-Options: nosniff führt ein falscher Typ dazu, dass Stylesheets und Skripte komplett blockiert werden. Bei Uploads solltest du dem vom Client gesendeten Typ nie vertrauen, sondern den Inhalt der Datei (ihre Magic Bytes) auf dem Server prüfen.
MIME-Typ-Suche
Durchsuche alle gängigen Dateiendungen und MIME-Typen mit sofort kopierbaren Content-Type-Headern.
Häufige Fragen
Welcher MIME-Typ gilt für .exe?
application/vnd.microsoft.portable-executable. Andere Varianten, die man in der Praxis sieht: application/octet-stream.Wie setze ich den Content-Type für .exe in Nginx?
application/vnd.microsoft.portable-executable exe; im types-Block steht (meist in /etc/nginx/mime.types), und lade Nginx neu.