'Move file via Microsoft Graph and create new version if file already exists
Moving a file without additional parameters fails when a file with the same name already exists in the target directory. We can use additional data and set conflict behavior replace, but then the old file gets replaced completely.
var driveItem = new DriveItem()
{
ParentReference = new ItemReference
{
Id = newFolderId
},
AdditionalData = new Dictionary<string, object>
{
{ "@microsoft.graph.conflictBehavior", "replace" }
}
};
What we want/need is a way to move the file and on conflict add it as a new version of the old file so that all old conflict files are still accessible via the version history.
Is that possible somehow?
BR Matthias
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
