MIMETYPE 与 Content_type的关系
2013-11-21 19:58
218 查看
MIME Type 与 Content-Type 的关系
当web服务器收到静态的资源文件请求时,依据请求文件的后缀名在服务器的MIME配置文件中找到对应的MIME Type,再根据MIME Type设置HTTP Response的Content-Type,然后浏览器根据Content-Type的值处理文件。首先看看tomcat服务器中默认的web.xml中的描述:
<!-- ===================== Default MIME Type Mappings =================== -->
<!-- When serving static resources, Tomcat will automatically generate -->
<!-- a "Content-Type" header based on the resource's filename extension, -->
<!-- based on these mappings. Additional mappings can be added here (to -->
<!-- apply to all web applications), or in your own application's web.xml -->
<!-- deployment descriptor. -->
再看看apache服务器中mime.types的描述:
# This file controls what Internet media types are sent to the client for
# given file extension(s). Sending the correct media type to the client
# is important so they know how to handle the content of the file.
# Extra types can either be added here or by using an AddType directive
# in your config files. For more information about Internet media types,
# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
# registry is at <http://www.iana.org/assignments/media-types/>.
相关文章推荐
- 常见文件后缀名和Content-type/mime type对应关系
- response.setContentType()中MIME参数类型总结
- 常见文件的http中content-type头的值(MIME类型)
- 常见文件的http中content-type头的值(MIME类型)
- content-type头 (MIME类型)
- PHP function mime_content_type() is missing, try enabling fileinfo module.
- Content-Type与MIME
- mime-type与content-type
- Java如何获取Content-Type的文件类型Mime Type
- MIME Type介绍 Content-Type 各种定义
- [MIME] Content-Type 、IE、MIME和 注册表的那些事 (text/plain 文件 下载)
- MIME 类型(HttpContext.Response.ContentType)列表
- Request.ContentType页面输出方式Gets or sets the MIME content type of the incoming request
- Android HTTP Content-type( Mime-Type)对照表
- Jsoup获取部分页面数据失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/
- MIME 类型(HttpContext.Response.ContentType)列表[转]
- response.setContentType()的作用及MIME参数详解
- HTTP Content-Type(MIME-Type) 与扩展名 Extension 对照表
- response.setContentType()中MIME参数类型总结
- Content-Type(Mime-Type) 对照表