String UserAgent = request.getHeader("USER-AGENT").toLowerCase();
response.reset();
response.setContentType("application/x-msdownload");
String fileName = CacheManager.getContent(file.getName(),String.class);
if (UserAgent.indexOf("firefox") >= 0) {
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\"");
}else{
response.addHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, "utf-8") + "\"");
}
response.reset();
response.setContentType("application/x-msdownload");
String fileName = CacheManager.getContent(file.getName(),String.class);
if (UserAgent.indexOf("firefox") >= 0) {
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\"");
}else{
response.addHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fileName, "utf-8") + "\"");
}