About PowerPoint 97–2003 presentation files
The binary PowerPoint format, in the same OLE2 container as .doc and .xls. Browsers can’t display it, so it is always downloaded.
File signature
PPT files start with D0 CF 11 E0 A1 B1 1A E1 (OLE2 compound file). 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 .ppt with the right Content-Type
Content-Type: application/vnd.ms-powerpoint
application/vnd.ms-powerpoint ppt pps pot;
AddType application/vnd.ms-powerpoint .ppt .pps .pot
@ppt path *.ppt *.pps *.pot
header @ppt Content-Type "application/vnd.ms-powerpoint"
curl -sI https://example.com/file.ppt | grep -i '^content-type'
# Content-Type: application/vnd.ms-powerpoint
Set the type in code
res.set('Content-Type', 'application/vnd.ms-powerpoint');
// Or make the browser download it:
res.attachment('file.ppt');
import mimetypes
mimetypes.add_type('application/vnd.ms-powerpoint', '.ppt') # if your system doesn't know it
mimetypes.guess_type('file.ppt')[0] # 'application/vnd.ms-powerpoint'
mime.AddExtensionType(".ppt", "application/vnd.ms-powerpoint")
w.Header().Set("Content-Type", "application/vnd.ms-powerpoint")
Accept .ppt uploads
<input type="file" accept=".ppt,.pps,.pot,application/vnd.ms-powerpoint">
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
-
.pptx (
application/vnd.openxmlformats-officedocument.presentationml.presentation): PowerPoint presentation -
.pdf (
application/pdf): PDF document -
.doc (
application/msword): Word 97–2003 document
More documents
.docx , .xls , .xlsx , .odt , .rtf , .epub . Look up any extension or type with the MIME type lookup.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What is the MIME type for .ppt files?
application/vnd.ms-powerpoint. The full header is "Content-Type: application/vnd.ms-powerpoint".
Why does my server send the wrong Content-Type for .ppt?
Web servers pick the type from the file extension using a table (mime.types in nginx and Apache). If .ppt 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 PPT?
Look at the first bytes rather than the extension or the type the browser reports, which both come from the file name. PPT files start with D0 CF 11 E0 A1 B1 1A E1 (OLE2 compound file). The MIME type lookup on this site reads them for you when you drop a file on it.