Mga karaniwang MIME type
Ang mga server at upload form ay umaasa sa mga string na ito; ang maling type ay maaaring makasira sa preview, download, o Content Security Policy.
| Uri | MIME type | Karaniwang ext |
|---|---|---|
| HTML | text/html | .html |
| CSS | text/css | .css |
| JavaScript | text/javascript | .js |
| JSON | application/json | .json |
| XML | application/xml | .xml |
| Plain text | text/plain | .txt |
| CSV | text/csv | .csv |
| application/pdf | ||
| ZIP | application/zip | .zip |
| PNG | image/png | .png |
| JPEG | image/jpeg | .jpg |
| GIF | image/gif | .gif |
| WebP | image/webp | .webp |
| SVG | image/svg+xml | .svg |
| ICO | image/x-icon | .ico |
| MP3 | audio/mpeg | .mp3 |
| WAV | audio/wav | .wav |
| MP4 | video/mp4 | .mp4 |
| WebM | video/webm | .webm |
| WOFF2 | font/woff2 | .woff2 |
| Form URL-encoded | application/x-www-form-urlencoded | — |
| Multipart form | multipart/form-data | — |
Tala
- May mga browser na sumisinghot ng content; ipadala pa rin ang tamang type mula sa server.
- Ang opisyal na type ng JS ay text/javascript (obsolete na ang application/javascript).
Mga madalas itanong
- Anong MIME type ang dapat kong gamitin para sa .json file?
- Gumamit ng application/json para sa mga JSON file at API response. Ito ang standard type at dapat i-serve na may UTF-8 kung posible.
- Ano ang MIME type para sa .js files?
- Ang opisyal na type para sa JavaScript ay text/javascript. Ang mas lumang application/javascript ay obsolete at hindi na dapat gamitin.
- Anong MIME type ang ginagamit ng isang SVG image?
- Ang mga SVG file ay gumagamit ng image/svg+xml. Siguraduhing i-serve ang mga ito bilang SVG, hindi image/xml, o hindi ito ire-render ng browser nang inline.