5
我試圖將文件從網絡驅動器位置複製到R中的共享點庫。共享點庫位置需要用戶身份驗證,我在想如何才能複製這些文件並在代碼中傳遞身份驗證。一個簡單的file.copy不起作用。我試圖使用RCurl
庫中的getURL()
函數,但那也沒有奏效。我想知道如何完成這項任務 - 在傳遞身份驗證的同時複製文件。將文件複製到R中的共享點庫
這裏是我迄今爲止嘗試了一些代碼片段:
library(RCurl)
from <- "filename"
to <- "\\\\sharepoint.company.com\\Directory" #First attempt with just sharepoint location
to <- "file://sharepoint.company.com/Directory" #Another attempt with different format
h = getCurlHandle(header = TRUE, userpwd = "username:password")
getURL(to, verbose = TRUE, curl = h)
status <- file.copy(from, to)
謝謝!