setContentType(String type)方法里的参数type是指一个用于指定文件内容的MIME类型
常见的MIME类型及含义:
text/html 超文本标记语言文本(.html)
text/plain 普通文本(.txt)
image/gif GIF图形(.gif)
image/jpeg JPEG图形(.jpeg或.jpg)
video/x-msvideo AVI文件(.avi)
application/zip zip压缩包(.zip)
application/msword word文档(.doc)
application/vnd.ms-excel excel文档(.xls)
audio/x-mpeg mp3音乐文件(.mp3)
response.setContentType
最新推荐文章于 2023-04-20 16:02:18 发布