📄Media Type (MIME Type)
Also known as MIME Type, Content Type, Internet Media Type
A label like image/png. It names the kind of data a server sends.
Think of it like
Think of it like the label on a box. It says what is inside, so the right person opens it.
Example
A server sends Lucy a file marked as a PDF. Her browser opens it in its PDF viewer, not as raw bytes.
Why it matters
Browsers trust this label more than the file name. A wrong label can show code as text or download a page it should show.
Definition
Example code
console
$ file --mime-type photo.png
photo.png: image/pngCommon mistake
Key takeaways
- 1Two parts. A kind and a subtype, joined by a slash.
- 2Sent in a header. Content-Type carries it on the web.
- 3Beats the name. Browsers trust the label, not the extension.