/**
*
* 导出文件名称
*
*/
private String downloadFileName;
public String getDownloadFileName() {
return downloadFileName;
}
public void setDownloadFileName(String downloadFileName) {
HttpServletRequest request = ServletActionContext.getRequest();
String Agent = request.getHeader("User-Agent");
if (null != Agent) {
Agent = Agent.toLowerCase();
//火狐浏览器
if (Agent.indexOf("firefox") != -1) {
downloadFileName = new String(downloadFileName.getBytes(), "ISO-8859-1");
} else {
downloadFileName = new String(downloadFileName.getBytes(), "UTF-8");
}
} else {
downloadFileName = new String(downloadFileName.getBytes(), "UTF-8");
}
this.downloadFileName = downloadFileName;
}
浏览器文件导出、下载(文件名)乱码解决方法
最新推荐文章于 2022-12-16 08:00:00 发布