Search code examples
onedrive

onedrive new api for upload conflict


I am using the onedrive new api to do resumable upload by doc: http://onedrive.github.io/items/upload_large_files.htm#create-an-upload-session

even I set the param name.conflictBehavior: replace after the last fragment be uploaded, it still return the 409 conflict error

Even I change the behavior to rename, the same response got.

I wonder if I make fail parameters while create upload session:

headers = {'Authorization': 'Bearer <access_token>',
           'Content-Type': 'application/json'}
params = {'@name.conflictBehavior': 'replace'}
try:
    res = request.post(url, headers=headers, data=params)
except Exception as e:
    print e

after doing that I could get the upload url with param behind the url. but after the last fragment uploaded, the 409 error occurred.

Is this a bug or just the parameters I pass are wrong, I have no idea.


Solution

  • Looks like we have a bug here where we don't honor the @name.conflictBehavior annotation in that scenario. We're working on a fix.