MIME是服务器通知客户机传送文件是什么类型的主要方法,客户机浏览器也通过MIME告诉服务器它的参数。
response.setContentType() 的作用是使客户端浏览器,区分不同种类的数据,并根据不同的MIME调用浏览器内不同的程序嵌入模块来处理相应的数据
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; application/octet-stream意思是八进制文件更新,是火狐的更新文件.