response.setContentType(String Type)

作者: harde 分类: DotNet,Java 发布时间: 2009-06-23 16:33

image/bmp –> BMP
image/gif –> GIF
image/jpeg –> JPEG
image/tiff –> TIFF
image/x-dcx –> DCX
image/x-pcx –> PCX
text/html –> HTML
text/plain –> TXT
text/xml –> XML
application/afp –> AFP
application/pdf –> PDF
application/rtf –> RTF
application/msword –> MSWORD
application/vnd.ms-excel –> MSEXCEL
application/vnd.ms-powerpoint –> MSPOWERPOINT
application/wordperfect5.1 –> WORDPERFECT
application/vnd.lotus-wordpro –> WORDPRO
application/vnd.visio –> VISIO
application/vnd.framemaker –> FRAMEMAKER
application/vnd.lotus-1-2-3 –> LOTUS123

另外说下  在指定类型的同时可以设定编码

举个例子:response.setContentType(“text/xml;charset=utf-8”)

常用的就那么几个,自己背背吧

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注