MIME is the primary method by which the server notifies the client of what type of file to transfer, and the client browser tells the server its parameters through mime.
On the web, if the received file does not have a MIME header, it defaults to HTML format. But this is not good, because when the MIME header is Text/plain, the browser will display directly without concern for its font, color and other parameters
The role of Response.setcontenttype () is to enable the client browser to distinguish between different kinds of data and to process the corresponding data according to different MIME calls within the browser to the different programs embedded in the module.
Case "Doc": ContentType = "Application/msword"; Bre
Case "Doc":
ContentType = "Application/msword";
Break
Case "PDF":
ContentType = "Application/pdf";
Break
Case "JPG":
Case "JPEG":
ContentType = "Image/jpeg";
Break
Case "GIF":
ContentType = "Image/gif";
Break
Case "Zip":
ContentType = "Application/zip";
Break
Case "TXT":
ContentType = "Text/plain";
Break
Case "htm":
Case "HTML":
ContentType = "text/html";
Break
Case "XLS":
ContentType = "application/vnd.ms-excel";
Break
Case "ppt":
ContentType = "Application/vnd.ms-powerpoint";
Break
Default
ContentType = "Application/octet-stream";
Break
It means the octal file update, which is the update file for Firefox.
Concepts to understand
Content-type: Defines how the user's browser or related device Displays the data that will be loaded, or how to handle the data that will be loaded
The Mime:mime type is the type of file that sets an extension that is opened by an application, and the browser automatically opens with the specified application when the extension file is accessed. Many are used to specify some client-customized file names, as well as some ways to open media files.
Text/html means that the content-type of the file is set to the form of text/html, and the browser automatically calls the HTML parser to process the file when it obtains the file.
Text/plain means that the file is formatted as plain text, and the browser does not process the file when it obtains it.
What is the difference between text/html and Text/plain?