String strOutFileExtName="";
response.reset();
if(strOutStyle.equals("excel")){
response.setContentType("application/OCTET-STREAM");
strOutFileExtName=".xls";
}else{
response.setContentType("application/csv;charset=Windows-31J");
strOutFileExtName=".csv";
}
response.setHeader("Content-disposition", "attachment;filename=test"+strOutFileExtName);通过IE执行,会弹出对话框,其中我选择打开的时候,为什么要点击两次才能打开文件呢.
response.reset();
if(strOutStyle.equals("excel")){
response.setContentType("application/OCTET-STREAM");
strOutFileExtName=".xls";
}else{
response.setContentType("application/csv;charset=Windows-31J");
strOutFileExtName=".csv";
}
response.setHeader("Content-disposition", "attachment;filename=test"+strOutFileExtName);通过IE执行,会弹出对话框,其中我选择打开的时候,为什么要点击两次才能打开文件呢.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货