mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged DEV to HEAD (5.0.0)
85514 : ACE-676 : Uploading new version of pdf sets mimetype to unknown - Use specialised write(content) method to ScriptNode to allow the mimetype, encoding etc. to all be calculated and applied in a single call. - We should not rely on mimetype sent by client. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@86155 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -237,10 +237,7 @@ function main()
|
||||
}
|
||||
|
||||
// Update the working copy content
|
||||
updateNode.properties.content.write(content);
|
||||
// Reset working copy mimetype and encoding
|
||||
updateNode.properties.content.guessMimetype(filename);
|
||||
updateNode.properties.content.guessEncoding();
|
||||
updateNode.properties.content.write(content, false, true);
|
||||
// check it in again, with supplied version history note
|
||||
|
||||
// Extract the metadata
|
||||
@@ -288,11 +285,7 @@ function main()
|
||||
if (existingFile.hasAspect("cm:versionable") && overwrite)
|
||||
{
|
||||
// Upload component was configured to overwrite files if name clashes
|
||||
existingFile.properties.content.write(content);
|
||||
|
||||
// Reapply mimetype as upload may have been via Flash - which always sends binary mimetype
|
||||
existingFile.properties.content.guessMimetype(filename);
|
||||
existingFile.properties.content.guessEncoding();
|
||||
existingFile.properties.content.write(content, false, true);
|
||||
|
||||
// Extract the metadata
|
||||
// (The overwrite policy controls which if any parts of
|
||||
|
Reference in New Issue
Block a user