什么是 MIME 类型? [英] What is a MIME type?

查看:36
本文介绍了什么是 MIME 类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读有关如何构建插件的文章,并且一直在讨论这种MIME 类型".我试图研究它并知道它是多用途 Internet 邮件扩展 (MIME),但没有提供关于它与浏览器插件的关系的合适解释,就像我需要了解它来构建插件一样,请用通俗易懂的语言解释.它是什么?为什么插件有 MIME 类型?

I have been reading about how to build plug-ins and this "MIME type" keeps getting discussed in it. I have tried to look into it and know that it is Multipurpose Internet Mail Extensions (MIME) but no suitable explanation of how it relates to browser plug-ins, as in what I need to know about it for building plug-ins, is provided, please explain in clear and simple words. What is it? Why do plug-ins have a MIME type?

推荐答案

MIME 类型是用于标识数据类型的标签.使用它是为了让软件知道如何处理数据.它在 Internet 上的作用与文件扩展名在 Microsoft Windows 上的作用相同.

A MIME type is a label used to identify a type of data. It is used so software can know how to handle the data. It serves the same purpose on the Internet that file extensions do on Microsoft Windows.

因此,如果服务器说这是文本/html",客户端可以啊,这是一个 HTML 文档,我可以在内部呈现它",而如果服务器说这是应用程序/pdf",客户端可以去啊,我需要启动用户已安装的 FoxIt PDF 阅读器插件,该插件已将自身注册为应用程序/pdf 处理程序."

So if a server says "This is text/html" the client can go "Ah, this is an HTML document, I can render that internally", while if the server says "This is application/pdf" the client can go "Ah, I need to launch the FoxIt PDF Reader plugin that the user has installed and that has registered itself as the application/pdf handler."

您最常在 HTTP 消息的标头中找到它们(描述 HTTP 服务器响应的内容或请求中发布的数据的格式)和电子邮件标头(描述消息格式和附件).

You'll most commonly find them in the headers of HTTP messages (to describe the content that an HTTP server is responding with or the formatting of the data that is being POSTed in a request) and in email headers (to describe the message format and attachments).

这篇关于什么是 MIME 类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆