Kiểu MIME của .odt: application/vnd.oasis.opendocument.text

Các file có đuôi .odt (văn bản OpenDocument) sử dụng kiểu MIME application/vnd.oasis.opendocument.text.

Cập nhật

application/vnd.oasis.opendocument.text
Kiểu MIME cho .odt
Tài liệu
Danh mục
Không
Nén bằng gzip/Brotli

Kiểu MIME của file .odt là gì?

Kiểu MIME (media type) của file văn bản OpenDocument có đuôi .odt là application/vnd.oasis.opendocument.text. Đây là định dạng của LibreOffice Writer, dựa trên ZIP.

Header Content-Type

Content-Type: application/vnd.oasis.opendocument.text

Cấu hình máy chủ

Máy chủCấu hình
Nginx (mime.types or types {})application/vnd.oasis.opendocument.text odt;
Apache (.htaccess)AddType application/vnd.oasis.opendocument.text .odt
IIS (web.config)<mimeMap fileExtension=".odt" mimeType="application/vnd.oasis.opendocument.text" />
Node.js / Expressres.type('odt') or res.setHeader('Content-Type', 'application/vnd.oasis.opendocument.text')
Amazon S3Đặt Content-Type: application/vnd.oasis.opendocument.text cho object (metadata), hoặc truyền --content-type application/vnd.oasis.opendocument.text vào aws s3 cp

File .odt có nên nén không?

Không. File văn bản OpenDocument đã được nén sẵn bên trong, nên dùng gzip hay Brotli chỉ tốn CPU và hầu như không giảm dung lượng — đôi khi còn làm tăng. Hãy loại application/vnd.oasis.opendocument.text khỏi cấu hình nén của bạn.

Vì sao kiểu MIME quan trọng

Trình duyệt quyết định cách xử lý phản hồi — hiển thị, thực thi, phát hay tải xuống — dựa trên header Content-Type, chứ không phải đuôi file. Với X-Content-Type-Options: nosniff, kiểu sai khiến stylesheet và script bị chặn hoàn toàn. Với file tải lên, đừng bao giờ tin kiểu do client gửi; hãy kiểm tra nội dung file (magic bytes) trên máy chủ.

Câu hỏi thường gặp

Kiểu MIME của .odt là gì?
application/vnd.oasis.opendocument.text.
Làm thế nào để đặt Content-Type cho .odt trong Nginx?
Đảm bảo application/vnd.oasis.opendocument.text odt; có trong khối types (thường nằm ở /etc/nginx/mime.types) rồi tải lại Nginx.
Có nên gzip file .odt không?
Không — định dạng này đã được nén sẵn, nên nén HTTP không mang lại lợi ích gì.