HTTP Content-Type 常用对照表

2018/05/21 233

如果我们做的是类似网盘的应用,需要根据后缀名动态得到Content-Type,可使用用:
MimeTypeMap
Provides a huge dictionary of file extensions to mime types.

扩展名 Content-Type(Mime-Type)
.txt text/plain
.csv text/csv
.xml text/xml
.html/.htm text/html
.css text/css
.xls application/x-xls
.doc application/msword
.ppt application/vnd.ms-powerpoint
.pdf application/pdf
.bmp application/x-bmp
.gif image/gif
.ico image/x-icon
.jpeg image/jpeg
.jpg application/x-jpg
.png image/png
.svg text/xml
.mp3 audio/mp3
.avi video/avi
.mp4 video/mpeg4
.rmvb application/vnd.rn-realmedia-vbr
.dll application/x-msdownload
.ps application/x-ps
.apk application/vnd.android.package-archive
.java java/*
.cer application/x-x509-ca-cert
评论