解决在IE下下载时文件名乱码

String agent = request.getHeader("USER-AGENT");
if (agent != null && agent.indexOf("MSIE") == -1) {// FF
	response.setHeader("Content-Disposition", "attachment; filename="
			+new String(fileData.getFileName().getBytes("utf-8"), "ISO8859-1"));
} else {// IE
	response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileData.getFileName(), "UTF-8"));
}

 d

你可能感兴趣的:(IE)