mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
57029: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 56496: Merged HEAD-BUG-FIX to V4.2-BUG-FIX (4.2.1) 55754: Merged V4.1-BUG-FIX (4.1.7) to HEAD-BUG-FIX 54754: Merged V4.1.6 (4.1.6) to V4.1-BUG-FIX (4.1.7) 54570: MNT-2258: IE's File Download box does not show a filename correctly when that have non-ASCII characters in the filename For file download in IE8 use legacy filename token with encoded value in "Content-Disposition" header git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61662 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -79,7 +79,7 @@ public class ContentInfo extends StreamContent
|
|||||||
boolean attach, Date modified, String eTag, String attachFileName)
|
boolean attach, Date modified, String eTag, String attachFileName)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
setAttachment(res, attach, attachFileName);
|
delegate.setAttachment(req, res, attach, attachFileName);
|
||||||
|
|
||||||
// establish mimetype
|
// establish mimetype
|
||||||
String mimetype = reader.getMimetype();
|
String mimetype = reader.getMimetype();
|
||||||
|
@@ -526,7 +526,7 @@ public class ContentStreamer implements ResourceLoaderAware
|
|||||||
String attachFileName,
|
String attachFileName,
|
||||||
Map<String, Object> model) throws IOException
|
Map<String, Object> model) throws IOException
|
||||||
{
|
{
|
||||||
setAttachment(res, attach, attachFileName);
|
setAttachment(null, res, attach, attachFileName);
|
||||||
|
|
||||||
// establish mimetype
|
// establish mimetype
|
||||||
String mimetype = reader.getMimetype();
|
String mimetype = reader.getMimetype();
|
||||||
@@ -611,11 +611,12 @@ public class ContentStreamer implements ResourceLoaderAware
|
|||||||
/**
|
/**
|
||||||
* Set attachment header
|
* Set attachment header
|
||||||
*
|
*
|
||||||
|
* @param req
|
||||||
* @param res
|
* @param res
|
||||||
* @param attach
|
* @param attach
|
||||||
* @param attachFileName
|
* @param attachFileName
|
||||||
*/
|
*/
|
||||||
public void setAttachment(WebScriptResponse res, boolean attach, String attachFileName)
|
public void setAttachment(WebScriptRequest req, WebScriptResponse res, boolean attach, String attachFileName)
|
||||||
{
|
{
|
||||||
if (attach == true)
|
if (attach == true)
|
||||||
{
|
{
|
||||||
@@ -625,7 +626,25 @@ public class ContentStreamer implements ResourceLoaderAware
|
|||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
logger.debug("Attaching content using filename: " + attachFileName);
|
logger.debug("Attaching content using filename: " + attachFileName);
|
||||||
|
|
||||||
headerValue += "; filename*=UTF-8''" + WebDAVHelper.encodeURL(attachFileName) + "; filename=\"" + attachFileName + "\"";
|
if (req == null)
|
||||||
|
{
|
||||||
|
headerValue += "; filename*=UTF-8''" + WebDAVHelper.encodeURL(attachFileName)
|
||||||
|
+ "; filename=\"" + attachFileName + "\"";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
String userAgent = req.getHeader(HEADER_USER_AGENT);
|
||||||
|
boolean isMSIE8 = (null != userAgent) && userAgent.contains("MSIE 8");
|
||||||
|
if (isMSIE8)
|
||||||
|
{
|
||||||
|
headerValue += "; filename=\"" + WebDAVHelper.encodeURL(attachFileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
headerValue += "; filename=\"" + attachFileName + "\"; filename*=UTF-8''"
|
||||||
|
+ WebDAVHelper.encodeURL(attachFileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set header based on filename - will force a Save As from the browse if it doesn't recognize it
|
// set header based on filename - will force a Save As from the browse if it doesn't recognize it
|
||||||
|
@@ -60,7 +60,7 @@ public class StreamContent extends AbstractWebScript
|
|||||||
protected PermissionService permissionService;
|
protected PermissionService permissionService;
|
||||||
protected NodeService nodeService;
|
protected NodeService nodeService;
|
||||||
protected MimetypeService mimetypeService;
|
protected MimetypeService mimetypeService;
|
||||||
private ContentStreamer delegate;
|
protected ContentStreamer delegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mimetypeService
|
* @param mimetypeService
|
||||||
@@ -194,7 +194,7 @@ public class StreamContent extends AbstractWebScript
|
|||||||
*/
|
*/
|
||||||
protected void setAttachment(WebScriptResponse res, boolean attach, String attachFileName)
|
protected void setAttachment(WebScriptResponse res, boolean attach, String attachFileName)
|
||||||
{
|
{
|
||||||
delegate.setAttachment(res, attach, attachFileName);
|
delegate.setAttachment(null, res, attach, attachFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user