下面是一个较为全面的常见文件类型及其对应的MIME类型列表。文件类型按类别进行分类,包括文本文件、图像文件、音频文件、视频文件、文档文件、压缩文件等。
1. 文本文件
-
Plain Text (TXT):
text/plain
-
HTML:
text/html
-
CSS:
text/css
-
JavaScript (JS):
application/javascript
-
JSON:
application/json
-
XML:
application/xml
-
YAML:
text/yaml
或application/x-yaml
-
CSV (Comma-Separated Values):
text/csv
-
Markdown (MD):
text/markdown
-
Rich Text Format (RTF):
application/rtf
-
Batch File (BAT):
application/x-msdos-program
-
Shell Script (SH):
application/x-sh
-
Python Script (PY):
text/x-python
或application/x-python
2. 图像文件
-
JPEG (JPG):
image/jpeg
-
PNG:
image/png
-
GIF:
image/gif
-
BMP:
image/bmp
-
TIFF:
image/tiff
-
SVG:
image/svg+xml
-
WebP:
image/webp
-
ICO (Icon):
image/x-icon
-
HEIC:
image/heic
-
PSD (Adobe Photoshop):
image/vnd.adobe.photoshop
3. 音频文件
-
MP3:
audio/mpeg
-
WAV:
audio/wav
-
OGG:
audio/ogg
-
MIDI:
audio/midi
-
FLAC:
audio/flac
-
AAC:
audio/aac
-
WMA:
audio/x-ms-wma
-
AIFF:
audio/aiff
4. 视频文件
-
MP4:
video/mp4
-
AVI:
video/x-msvideo
-
WebM:
video/webm
-
MPEG:
video/mpeg
-
MKV:
video/x-matroska
-
MOV (QuickTime):
video/quicktime
-
WMV:
video/x-ms-wmv
-
FLV:
video/x-flv
-
3GP:
video/3gpp
-
OGV:
video/ogg
5. 文档文件
-
PDF:
application/pdf
-
Microsoft Word (DOC):
application/msword
-
Microsoft Word (DOCX):
application/vnd.openxmlformats-officedocument.wordprocessingml.document
-
Microsoft Excel (XLS):
application/vnd.ms-excel
-
Microsoft Excel (XLSX):
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
-
Microsoft PowerPoint (PPT):
application/vnd.ms-powerpoint
-
Microsoft PowerPoint (PPTX):
application/vnd.openxmlformats-officedocument.presentationml.presentation
-
OpenDocument Text (ODT):
application/vnd.oasis.opendocument.text
-
OpenDocument Spreadsheet (ODS):
application/vnd.oasis.opendocument.spreadsheet
-
OpenDocument Presentation (ODP):
application/vnd.oasis.opendocument.presentation
-
EPUB (Ebook):
application/epub+zip
-
MOBI (Ebook):
application/x-mobipocket-ebook
-
LaTeX (TEX):
application/x-latex
6. 压缩文件
-
ZIP:
application/zip
-
GZIP (GZ):
application/gzip
-
7-Zip (7Z):
application/x-7z-compressed
-
RAR:
application/vnd.rar
-
TAR:
application/x-tar
-
BZIP2 (BZ2):
application/x-bzip2
-
XZ:
application/x-xz
-
ISO (Disk Image):
application/x-iso9660-image
7. 编程语言相关文件
-
Java (JAR):
application/java-archive
-
Java Class (CLASS):
application/java-vm
-
C/C++ Source Code (C, CPP):
text/x-csrc
,text/x-c++src
-
Java Source Code (JAVA):
text/x-java-source
-
PHP:
application/x-httpd-php
-
Perl (PL):
application/x-perl
-
Ruby (RB):
application/x-ruby
-
Go (GO):
text/x-go
-
Swift (SWIFT):
text/x-swift
-
Kotlin (KT):
text/x-kotlin
8. 字体文件
-
TrueType Font (TTF):
font/ttf
-
OpenType Font (OTF):
font/otf
-
Web Open Font Format (WOFF):
font/woff
-
Web Open Font Format 2 (WOFF2):
font/woff2
9. 其他常见文件类型
-
SQL:
application/sql
-
Markdown (MD):
text/markdown
-
CSV (Comma-Separated Values):
text/csv
-
TOML:
application/toml
-
INI:
text/plain
-
VCard (VCF):
text/vcard
-
Log File (LOG):
text/plain
-
Executable (EXE):
application/vnd.microsoft.portable-executable
10. 图形文件
-
Scalable Vector Graphics (SVG):
image/svg+xml
-
Portable Network Graphics (PNG):
image/png
-
Graphics Interchange Format (GIF):
image/gif
11. 脚本和配置文件
-
Shell Script (SH):
application/x-sh
-
Batch Script (BAT):
application/x-msdos-program
-
PowerShell Script (PS1):
application/x-powershell
总结
以上列出了广泛使用的各种文件类型及其MIME类型。这个列表几乎涵盖了大多数常见的文件类型,如果你需要处理文件上传、下载或内容类型验证,这些MIME类型将非常有用。如果有特殊需求,可能还需要查阅特定应用程序或系统使用的文件类型和MIME类型。