About PowerPoint presentation files
A ZIP archive of XML and media files, with slides under ppt/slides/. Presentations are mostly images and video that are already compressed, so they gain little from gzip.
File signature
PPTX files start with 50 4B 03 04 ("PK", a ZIP archive). The extension and the type a browser reports for an upload both
come from the file name, so check these bytes on the server before trusting a file.
Serve .pptx with the right Content-Type
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation .pptx
@pptx path *.pptx
header @pptx Content-Type "application/vnd.openxmlformats-officedocument.presentationml.presentation"
curl -sI https://example.com/file.pptx | grep -i '^content-type'
# Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
Set the type in code
res.set('Content-Type', 'application/vnd.openxmlformats-officedocument.presentationml.presentation');
// Or make the browser download it:
res.attachment('file.pptx');
import mimetypes
mimetypes.add_type('application/vnd.openxmlformats-officedocument.presentationml.presentation', '.pptx') # if your system doesn't know it
mimetypes.guess_type('file.pptx')[0] # 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
mime.AddExtensionType(".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation")
w.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.presentationml.presentation")
Accept .pptx uploads
<input type="file" accept=".pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation">
The accept attribute only filters the file picker; users can still choose another file. Listing the
extension as well as the type matters, because operating systems don’t always report the type you expect.
Related types
-
.ppt (
application/vnd.ms-powerpoint): PowerPoint 97–2003 presentation -
.docx (
application/vnd.openxmlformats-officedocument.wordprocessingml.document): Word document -
.pdf (
application/pdf): PDF document
More documents
.doc , .xls , .xlsx , .odt , .rtf , .epub . Look up any extension or type with the MIME type lookup.
Sources
- IANA registration: application/vnd.openxmlformats-officedocument.presentationml.presentation
- MDN: Common media types
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What is the MIME type for .pptx files?
application/vnd.openxmlformats-officedocument.presentationml.presentation. The full header is "Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation".
Why does my server send the wrong Content-Type for .pptx?
Web servers pick the type from the file extension using a table (mime.types in nginx and Apache). If .pptx is missing from that table, they send a default such as application/octet-stream or text/plain. Add the mapping as shown on this page, then check the response with "curl -sI".
How can I check that a file really is PPTX?
Look at the first bytes rather than the extension or the type the browser reports, which both come from the file name. PPTX files start with 50 4B 03 04 ("PK", a ZIP archive). The MIME type lookup on this site reads them for you when you drop a file on it.