application/vnd.openxmlformats-officedocument.wordprocessingml.document
Basic information
| Type | application |
|---|---|
| Subtype | vnd.openxmlformats-officedocument.wordprocessingml.document |
| Structured suffix | None |
| File extensions | .docx |
| Category | Application |
| Standard | IANA media type registry or common platform registration |
MIME anatomy
application/vnd.openxmlformats-officedocument.wordprocessingml.document has a top-level type of application and a subtype of vnd.openxmlformats-officedocument.wordprocessingml.document. The top-level type tells clients the broad handling model, while the subtype identifies the exact format, codec family, document type, or container.
| Part | Value | What to check |
|---|---|---|
| Top-level type | application | Controls broad behavior such as text rendering, image decoding, download handling, or multipart parsing. |
| Subtype | vnd.openxmlformats-officedocument.wordprocessingml.document | Should match the real file format, not only the filename extension. |
| Structured suffix | None | No structured suffix is declared for this type. |
| Charset | UTF-8 | Use charset=utf-8 when clients need deterministic text decoding. |
| Binary payload | No | Text-aware tooling may inspect or transform the body when the charset is correct. |
HTTP header
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=utf-8Common use
Use application/vnd.openxmlformats-officedocument.wordprocessingml.document in Content-Type and Accept headers when serving or requesting Word document. Correct MIME types help browsers, APIs, uploads, and download workflows handle files safely and predictably.
Browser support depends on the media type and the feature using it. Browsers can download almost any MIME type, but only selected text, image, audio, video, font, and document types are rendered natively.
For uploads, do not trust the file extension alone. Check the declared MIME type, validate the file signature when security matters, and store the original extension separately from the trusted server-side classification.
Browser and API behavior
| Context | How application/vnd.openxmlformats-officedocument.wordprocessingml.document is used | Practical check |
|---|---|---|
| HTTP response | Send application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=utf-8 so clients choose the right parser or renderer. | Inspect the Network panel and confirm the response header, not just the file extension. |
| HTTP request | Use Accept: application/vnd.openxmlformats-officedocument.wordprocessingml.document when an API can return several formats. | Return 406 Not Acceptable or a documented fallback when the type is unavailable. |
| Upload form | Use file extension and declared MIME type as hints. | For risky uploads, verify magic bytes or parse the file before trusting it. |
| Storage | Store the trusted MIME classification separately from the original filename. | This keeps later downloads correct even if a user uploads a misleading name. |
Common mistakes
- Serving text content as
application/octet-streamwhen the browser or API client expectsapplication/vnd.openxmlformats-officedocument.wordprocessingml.document. - Assuming .docx proves the file is safe. Extensions are user-controlled and should be treated as hints.
- Omitting charset when clients need deterministic text decoding. For this type, UTF-8 is the usual choice.
HTML download
<a href="/download.docx" download type="application/vnd.openxmlformats-officedocument.wordprocessingml.document">Download file</a>fetch Accept header
fetch("/api/file", {
headers: { Accept: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }
});multer upload filter
const upload = multer({
fileFilter: (req, file, cb) => cb(null, file.mimetype === "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
});Express response
app.get("/file", async (req, res) => {
res.setHeader("Content-Type", "application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=utf-8");
res.send(await readFile("example.docx"));
});Flask response
from flask import send_file
@app.get("/file")
def file():
return send_file("example.docx", mimetype="application/vnd.openxmlformats-officedocument.wordprocessingml.document", as_attachment=False)Go net/http response
func handler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=utf-8")
http.ServeFile(w, r, "example.docx")
}Nginx type mapping
types {
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
}
default_type application/octet-stream;curl negotiation
curl -H "Accept: application/vnd.openxmlformats-officedocument.wordprocessingml.document" https://example.com/file.docxValidation checklist
| Check | Recommended handling |
|---|---|
| Declared type | Compare the uploaded or generated MIME value with application/vnd.openxmlformats-officedocument.wordprocessingml.document when this exact format is required. |
| Extension | Accept .docx only as a convenience signal, not as proof of content. |
| Signature or parser | Decode using the expected charset and reject malformed text when strict processing matters. |
| Download safety | Set Content-Disposition deliberately when the file should download instead of render inline. |
| Caching | Use cache headers that match the file lifecycle, especially for generated assets and user uploads. |