mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.4 to HEAD
24791: Fixed ALF-6560: MIME type not detected (set to application/octet-stream) when content written via FileFolderService git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@24886 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1133,7 +1133,17 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
{
|
||||
throw new InvalidTypeException("Unable to get a content writer for a folder: " + fileInfo);
|
||||
}
|
||||
return contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
|
||||
final ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
|
||||
// Ensure that a mimetype is set based on the filename (ALF-6560)
|
||||
// This has been removed from the create code in 3.4 to prevent insert-update behaviour
|
||||
// of the ContentData.
|
||||
if (writer.getMimetype() == null)
|
||||
{
|
||||
final String name = fileInfo.getName();
|
||||
writer.setMimetype(mimetypeService.guessMimetype(name));
|
||||
}
|
||||
// Done
|
||||
return writer;
|
||||
}
|
||||
|
||||
private String getExtension(String name)
|
||||
|
Reference in New Issue
Block a user