Tipe MIME .exe: application/vnd.microsoft.portable-executable

File berakhiran .exe (executable Windows) menggunakan tipe MIME application/vnd.microsoft.portable-executable.

Diperbarui

application/vnd.microsoft.portable-executable
Tipe MIME untuk .exe
Arsip
Kategori
Tidak
Kompres dengan gzip/Brotli

Apa tipe MIME untuk file .exe?

Tipe MIME (media type) untuk file Windows executable dengan ekstensi .exe adalah application/vnd.microsoft.portable-executable. Kamu mungkin juga melihat application/octet-stream. Sebagian besar server mengirim application/octet-stream, yang juga aman dipakai untuk memaksa unduhan.

Header Content-Type

Content-Type: application/vnd.microsoft.portable-executable

Konfigurasi server

ServerKonfigurasi
Nginx (mime.types atau 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 / Expressres.type('exe') atau res.setHeader('Content-Type', 'application/vnd.microsoft.portable-executable')
Amazon S3Atur Content-Type: application/vnd.microsoft.portable-executable pada objek (metadata), atau kirim --content-type application/vnd.microsoft.portable-executable ke aws s3 cp

Apakah file .exe perlu dikompres?

Tidak. File Windows executable sudah terkompres di dalamnya, jadi gzip atau Brotli hanya membuang CPU dan hampir tidak mengecilkan ukuran, bahkan kadang malah membesarkannya. Jangan masukkan application/vnd.microsoft.portable-executable ke dalam konfigurasi kompresi kamu.

Mengapa tipe MIME itu penting

Browser memutuskan apa yang harus dilakukan terhadap sebuah respons (menampilkan, menjalankan, memutar, atau mengunduh) berdasarkan header Content-Type, bukan ekstensi file. Dengan X-Content-Type-Options: nosniff, tipe yang salah bisa menyebabkan stylesheet dan script diblokir sepenuhnya. Untuk unggahan, jangan pernah percaya tipe yang dikirim klien; periksa isi file (magic bytes-nya) di server.

Pertanyaan yang sering diajukan

Apa tipe MIME untuk .exe?
application/vnd.microsoft.portable-executable. Alternatif yang sering ditemui: application/octet-stream.
Bagaimana cara mengatur Content-Type untuk .exe di Nginx?
Pastikan application/vnd.microsoft.portable-executable exe; sudah ada di blok types (biasanya di /etc/nginx/mime.types), lalu muat ulang Nginx.
Apakah file .exe perlu di-gzip?
Tidak. Formatnya sudah terkompres, jadi kompresi HTTP tidak memberikan manfaat.