Azure / Microsoft365R

R SDK for interacting with Microsoft 365 APIs
Other
313 stars 44 forks source link

Upload Issue #143

Closed UTexas80 closed 1 year ago

UTexas80 commented 1 year ago

Hello - I am unable to upload any files to my personal OneDrive. Although the file to be uploaded (test.xlsx) is not resident in my personal OneDrive directory ("/Documents") I get an error "An item with the same name already exists under the parent."

Here is the reproducible code along with the corresponding error:

library("here", "Microsoft365R")

cd$upload_file(here::here("ml/", "test.xlsx"), "Documents")

Error in process_response(res, match.arg(http_status_handler), simplify) : Conflict (HTTP 409). Failed to complete operation. Message: "_An item with the same name already exists under the parent.__"

Thank you for your time and consideration.

Any assistance you can provide is greatly appreciate.

hongooi73 commented 1 year ago

Can confirm I get the same error. I suspect the Graph API has changed from under me....

hongooi73 commented 1 year ago

Okay, this doesn't appear to be a bug as such. You have to specify the full path and filename for the destination, eg

cd$upload_file(here::here("ml/", "test.xlsx"), "Documents/test.xlsx")

I'll update the docs to reflect this.

UTexas80 commented 1 year ago

That worked @hongooi73 ! Thank you so much. I greatly appreciate you following up with a solution.