Forum Discussion
Paul_Red1
Dec 16, 2020Copper Contributor
Cannot get conflict behaviour to work with upload to sharePoint
Hi. I am trying to get the various settings of fail/replace/rename to work, in both C# code and when this has failed in Postman. I am using it in an upload session. The URL is https://graph.microsoft...
Paul_Red1
Dec 17, 2020Copper Contributor
Just to say I have this working - the documentation is appalling!
The page https://docs.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0
does not show that in the request the conflict behaviour setting should be wrapped in an "item" object. Please can we have some more examples in the documentation.
Thanks
rvpanchal
May 06, 2021Copper Contributor
Hi All, I am also facing the same issue in my code. While creating uploadsession, unable to get proper session created.
Even though the properties set to
"@microsoft.graph.conflictBehavior": "fail",
Its overwriting the files.
Could any one please help. I am using golang and Code is
http.newRequest(POST, URL, Body)
Body = {
"@microsoft.graph.conflictBehavior": conflictOption,
"description": "",
"name": filePath,
"item": map[string]string{"@microsoft.graph.conflictBehavior": conflictOption},
"deferCommit": true}
Also I have tried all possible combinations for setting up properties. graph api always sending response which is overwriting the file in onedrive.
Even though the properties set to
"@microsoft.graph.conflictBehavior": "fail",
Its overwriting the files.
Could any one please help. I am using golang and Code is
http.newRequest(POST, URL, Body)
Body = {
"@microsoft.graph.conflictBehavior": conflictOption,
"description": "",
"name": filePath,
"item": map[string]string{"@microsoft.graph.conflictBehavior": conflictOption},
"deferCommit": true}
Also I have tried all possible combinations for setting up properties. graph api always sending response which is overwriting the file in onedrive.