Microsoft365R icon indicating copy to clipboard operation
Microsoft365R copied to clipboard

Can't upload a file to replace an existing file

Open CreRecombinase opened this issue 1 year ago • 3 comments

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!

CreRecombinase avatar Jul 25 '22 19:07 CreRecombinase

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

hongooi73 avatar Jul 25 '22 20:07 hongooi73

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.

CreRecombinase avatar Jul 25 '22 20:07 CreRecombinase

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

hongooi73 avatar Jul 25 '22 20:07 hongooi73