RanonKahn
RanonKahn

Reputation: 862

Saving files to SharePoint folder from R

I am able to open a file from a SharePoint Folder from R running on Rshiny server. But, not able to save a file to the same folder. I get error message as shown below. I tried the solutions provided here Saving a file to Sharepoint with R and here Copying file to sharepoint library in R with no luck. Any suggestions?

df <- read.csv("http://sites.somecompany.com/sites/sitename/Documents/UserDocumentFolder/filename.csv")

write.csv(df, "http://sites.somecompany.com/sites/sitename/Documents/UserDocumentFolder/filename2.csv")

can only open URLs for readingError in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection

Upvotes: 2

Views: 11168

Answers (1)

RanonKahn
RanonKahn

Reputation: 862

I tried this and it worked:

system("curl --ntlm --user username:password --upload-file someFolder/FileToCopy.ext https://sites.somecompany.com/sites/sitename/Documents/UserDocumentFolder/FileToCopy.ext")

Upvotes: 3

Related Questions