Merged V4.1-BUG-FIX (4.1.8) to V4.2-BUG-FIX (4.2.1)

59442: Merged DEV to V4.1-BUG-FIX (4.1.8)
      59317: MNT-9900 : Alfresco Explorer is using URL Encoding when downloading a file
      Removed additional encoding of file name for IE browser.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/V4.2-BUG-FIX/root@59519 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tatyana Valkevych
2014-01-08 13:42:27 +00:00
parent bf6a628aa2
commit 40b4d6abab

View File

@@ -390,11 +390,7 @@ public abstract class BaseDownloadContentServlet extends BaseServlet
// IE requires that "Content-Disposition" header in case of "attachment" type should include
// "filename" part. See MNT-9900
String userAgent = req.getHeader(HEADER_USER_AGENT);
if (userAgent != null && userAgent.toLowerCase().contains("msie"))
{
res.setHeader(HEADER_CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(filename) + "\"");
}
else if (userAgent != null && (userAgent.toLowerCase().contains("firefox") || userAgent.toLowerCase().contains("safari")))
if (userAgent != null && (userAgent.toLowerCase().contains("firefox") || userAgent.toLowerCase().contains("safari")))
{
res.setHeader(HEADER_CONTENT_DISPOSITION, "attachment; filename=\"" + URLDecoder.decode(filename) + "\"");
}