Kiểu MIME của file .pptx là gì?
Kiểu MIME (media type) của file Microsoft PowerPoint có đuôi .pptx là application/vnd.openxmlformats-officedocument.presentationml.presentation. Đây là file Office Open XML dựa trên định dạng ZIP.
Header Content-Type
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation; charset=utf-8
Các kiểu dựa trên văn bản nên có charset để trình duyệt giải mã ký tự đúng cách.
Cấu hình máy chủ
| Máy chủ | Cấu hình |
|---|---|
Nginx (mime.types or types {}) | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; |
Apache (.htaccess) | AddType application/vnd.openxmlformats-officedocument.presentationml.presentation .pptx |
IIS (web.config) | <mimeMap fileExtension=".pptx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation" /> |
| Node.js / Express | res.type('pptx') hoặc res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.presentationml.presentation; charset=utf-8') |
| Amazon S3 | Đặt Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation trên đối tượng (metadata), hoặc truyền --content-type application/vnd.openxmlformats-officedocument.presentationml.presentation vào aws s3 cp |
File .pptx có nên nén không?
Không. File Microsoft PowerPoint đã được nén sẵn bên trong, nên 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.openxmlformats-officedocument.presentationml.presentation 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ý một 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 sẽ 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) ngay trên server.
Tra cứu MIME type
Tìm kiếm mọi đuôi file và kiểu MIME phổ biến, kèm header Content-Type sẵn sàng sao chép.
Câu hỏi thường gặp
MIME type của .pptx là gì?
application/vnd.openxmlformats-officedocument.presentationml.presentation.Làm sao đặt Content-Type cho .pptx trong Nginx?
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; có trong khối types (thường nằm ở /etc/nginx/mime.types) rồi tải lại Nginx.