response.setContentType()的String参数及对应类型

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


附件下载的话,需要做如下设置:
response.setContentType("application/octet-stream");
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
response.setHeader("content-disposition", "attachment;filename="+URLEncoder.encode(file.getName(),"utf-8"));  

你可能感兴趣的:(html,contenttype)