Copying file to sharepoint library in R

前端 未结 3 1921
耶瑟儿~
耶瑟儿~ 2021-01-12 17:56

I am trying to copy files from a network drive location to a sharepoint library in R. The sharepoint library location requires user authentication and I was wondering how I

3条回答
  •  萌比男神i
    2021-01-12 18:47

    I just use the following function to copy files to SharePoint. The only issue will be the file that was transferred will remain checked-out until the File is manually Checked-in for others to use.

     saveToSharePoint <- function(fileName) 
       { 
         cmd <- paste("curl --max-time 7200 --connect-timeout 7200 --ntlm --user","username:password", 
                  "--upload-file /home/username/FolderNameWhereTheFileToTransferExists/",fileName, 
                  "teamsites.OrganizationName.com/sites/PageTitle/Documents/UserDocumentation/FolderNameWhereTheFileNeedsToBeCopied/",fileName, sep = " ")
         system(cmd)
       } 
    
     saveToSharePoint("SomeFileName.Ext")
    

提交回复
热议问题