.doc MIME type
Word 97–2003 documentdocuments
application/mswordLegacy binary Word documents.
| MIME type | application/msword |
|---|---|
| Extensions | .doc |
| Content-Type | application/msword |
| Compress in transit? | No — already compressed |
| File signature | D0 CF 11 E0 A1 B1 1A E1 the OLE2 compound-file signature shared by legacy Office formats |
Good to know
- Macros in legacy Office files are a common malware vector; scan uploads.
Serve .doc files with the right type
The response header to send:
Content-Type: application/msword
Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:
nginx (inside the types block in mime.types)
application/msword doc;
Apache (.htaccess or server config)
AddType application/msword .doc
Express
res.set("Content-Type", "application/msword");Python
import mimetypes
mimetypes.add_type("application/msword", ".doc")HTML file input
<input type="file" accept=".doc,application/msword">
Check it
See what a server sends for a file, and what type a local file really is by its contents:
curl -sI https://example.com/file.doc | grep -i '^content-type:' file --mime-type file.doc
Frequently asked questions
What is the MIME type for .doc files?
application/msword.
What Content-Type header should a .doc file be served with?
Content-Type: application/msword. It's already compressed, so servers shouldn't gzip it.
How can I tell if a file is really a .doc?
Check its bytes rather than the extension: DOC files start with D0 CF 11 E0 A1 B1 1A E1 — the OLE2 compound-file signature shared by legacy Office formats. On the command line, file --mime-type name.doc does this for you.
Related types
Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options