MIME Type .docx: application/vnd.openxmlformats-officedocument.wordprocessingml.document

File berekstensi .docx (Microsoft Word) menggunakan MIME type application/vnd.openxmlformats-officedocument.wordprocessingml.document.

Diperbarui

application/vnd.openxmlformats-officedocument.wordprocessingml.document
MIME type untuk .docx
Dokumen
Kategori
Tidak
Kompres dengan gzip/Brotli

Apa MIME type untuk file .docx?

MIME type (media type) untuk file Microsoft Word dengan ekstensi .docx adalah application/vnd.openxmlformats-officedocument.wordprocessingml.document. Tipe ini merupakan arsip ZIP berisi file XML, sehingga sudah terkompresi. Server lama yang tidak mengenali tipe ini mungkin menyajikan file DOCX sebagai application/zip, sehingga browser menyimpannya sebagai .zip.

Header Content-Type

Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=utf-8

Tipe berbasis teks sebaiknya menyertakan charset agar browser dapat men-decode karakter dengan benar.

Konfigurasi server

ServerKonfigurasi
Nginx (mime.types atau types {})application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
Apache (.htaccess)AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document .docx
IIS (web.config)<mimeMap fileExtension=".docx" mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
Node.js / Expressres.type('docx') atau res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=utf-8')
Amazon S3Atur Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document pada objek (metadata), atau berikan --content-type application/vnd.openxmlformats-officedocument.wordprocessingml.document ke aws s3 cp

Apakah file .docx perlu dikompresi?

Tidak. File Microsoft Word sudah terkompresi secara internal, sehingga gzip atau Brotli hanya membuang CPU dan hampir tidak mengurangi ukuran — kadang malah membuatnya lebih besar. Jangan sertakan application/vnd.openxmlformats-officedocument.wordprocessingml.document dalam konfigurasi kompresi kamu.

Mengapa MIME type penting

Browser memutuskan apa yang dilakukan terhadap sebuah respons — ditampilkan, dijalankan, diputar, atau diunduh — berdasarkan header Content-Type, bukan ekstensi file. Dengan X-Content-Type-Options: nosniff, tipe yang salah 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 MIME type untuk .docx?
application/vnd.openxmlformats-officedocument.wordprocessingml.document.
Bagaimana cara mengatur Content-Type untuk .docx di Nginx?
Pastikan application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; tercantum dalam blok types (biasanya di /etc/nginx/mime.types), lalu muat ulang Nginx.
Apakah file .docx perlu di-gzip?
Tidak — formatnya sudah terkompresi, jadi kompresi HTTP tidak memberi manfaat.