Golang: http.newRequest for createuploadsession to upload large file to onedrive

%3CLINGO-SUB%20id%3D%22lingo-sub-2332588%22%20slang%3D%22en-US%22%3EGolang%3A%20http.newRequest%20for%20createuploadsession%20to%20upload%20large%20file%20to%20onedrive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2332588%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20create%20upload%20session%20to%20upload%20large%20files%20chunk%20by%20chunk%20using%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fdriveitem-createuploadsession%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Earticle%3C%2FA%3E.%26nbsp%3B%3CBR%20%2F%3ELanguage%20%3A%20golang%3C%2FP%3E%3CP%3ERequest%20type%20%3A%20Post%3C%2FP%3E%3CP%3EURL%20%3A%3CSPAN%3E%2Fusers%2F%7BuserId%7D%2Fdrive%2Fitems%2F%7BitemId%7D%2FcreateUploadSession%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Ebody%20%3A%26nbsp%3B%7B%3CBR%20%2F%3E%22%40microsoft.graph.conflictBehavior%22%3A%20conflictOption%2C%3CBR%20%2F%3E%22description%22%3A%20%22%22%2C%3CBR%20%2F%3E%22name%22%3A%20filePath%2C%3CBR%20%2F%3E%22item%22%3A%20map%5Bstring%5Dstring%7B%22%40microsoft.graph.conflictBehavior%22%3A%20conflictOption%7D%2C%3CBR%20%2F%3E%22deferCommit%22%3A%20true%7D%3CBR%20%2F%3E%3CBR%20%2F%3EIts%20always%20returning%20the%20session%20which%20is%20replace%2FOverwriting%20the%20exesting%20file.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ECould%20any%20one%20please%20help%20in%20this.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi All, 

 

I am trying to create upload session to upload large files chunk by chunk using this article
Language : golang

Request type : Post

URL :/users/{userId}/drive/items/{itemId}/createUploadSession

body : {
"@microsoft.graph.conflictBehavior": conflictOption,
"description": "",
"name": filePath,
"item": map[string]string{"@microsoft.graph.conflictBehavior": conflictOption},
"deferCommit": true}

Its always returning the session which is replace/Overwriting the exesting file. 

Could any one please help in this. 

0 Replies