MNT-19682 : Fix upload of document versions with different mime types (#623)

This commit is contained in:
Chris Shields
2020-04-23 17:01:00 +01:00
parent 0fc5c6b7bc
commit 6ee88d6906

View File

@@ -309,11 +309,11 @@ function main()
return;
}
var newFilename = filename;
if (updateNameAndMimetype)
{
//check to see if name is already used in folder
var existingFile = updateNode.getParent().childByNamePath(filename),
newFilename = filename;
var existingFile = updateNode.getParent().childByNamePath(filename);
var existingFileNodeRef = (existingFile !== null) ? String(existingFile.nodeRef) : '',
updateFileNodeRef = String(updateNodeRef);
if (existingFile !== null && existingFileNodeRef !== updateFileNodeRef)
@@ -354,7 +354,7 @@ function main()
}
// Update the working copy content
updateNode.properties.content.write(content, updateNameAndMimetype, true);
updateNode.properties.content.write(content, updateNameAndMimetype, true, newFilename);
// check it in again, with supplied version history note
// Extract the metadata