I am trying to copy files from a network drive to the sharepoint library in R. To host the sharepoint library, user authentication is required, and I was wondering how I can copy these files and authenticate in code. A simple .copy file does not work. I tried to use a function getURL()from the library RCurl, but that didn't work either. I was wondering how I can accomplish this task - copying files while transmitting authentication.
Here are some code snippets I've tried so far:
library(RCurl)
from <- "filename"
to <- "\\\\sharepoint.company.com\\Directory"
to <- "file://sharepoint.company.com/Directory"
h = getCurlHandle(header = TRUE, userpwd = "username:password")
getURL(to, verbose = TRUE, curl = h)
status <- file.copy(from, to)
Thank!
source
share