MIME 类型刚开始只是用于邮件系统辨别附件的内容类型,现在广泛用于互联网中,
内容类型分为两个级别:
a type and a subtype
- type说明这个数据所属大类,如文本文件,图像文件,应用程序文件
- subtype说明这个数据的具体分类,
举例如下:
text/html; the type is text, and the subtype is html
image/gif; the type is image, and the subtype is gif
所有当前支持的MIME类型可以从下面网站获得:
http://www.iana.org/assignments/media-types/.
MIME 类型也充许你定义自定义的类型,保子类型必须以x-开头,如下是一些被广泛使用的自定义类型:
x-bitmap
An X Windows bitmap image.
x-gzip
Data compressed in the GNU gzip format.
x-mif
A FrameMaker MIF document.
x-sd
A session directory protocol announcement, used to announce MBONE events.
x-shar
A shell archive; the Unix equivalent of a Windows or Macintosh self-extracting archive. Software shouldn't be configured to unpack shell archives automatically, because a shell archive can call any program the user who runs it has the rights to call.
x-tar
A tar archive.
x-gtar
A GNU tar archive