Azure / Microsoft365R

R SDK for interacting with Microsoft 365 APIs
Other
308 stars 42 forks source link

Can't upload a file to replace an existing file #124

Closed CreRecombinase closed 1 year ago

CreRecombinase commented 2 years ago

From reading the Microsoft Graph docs, it looks like it should be possible to overwrite a drive item with new file contents (i.e to call "upload" on a pre-existing file), but it looks like that isn't currently supported in the R package, are there plans to add this? Thanks!

hongooi73 commented 2 years ago

Replacing an existing file should work without problems. What happens when you try it?

CreRecombinase commented 2 years ago

The error I get looks like this:

> gb <- get_business_onedrive(auth_type="device_code")
Loading Microsoft Graph login for default tenant
> gb$upload_file(src = "inst/foo.docx",dest = "Documents/foo.docx")
Error in process_response(res, match.arg(http_status_handler), simplify) : 
  Conflict (HTTP 409). Failed to complete operation. Message:
A file with the same name is currently being uploaded. Change the filename and try to save again.
hongooi73 commented 2 years ago

That's probably an issue on the backend. Wait a few minutes (hours?) and try again.