Copying file to sharepoint library in R

前端 未结 3 1902
耶瑟儿~
耶瑟儿~ 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条回答
  • 2021-01-12 18:27

    If you have SharePoint online, you can navigate to that library and click on the "Sync to Computer" button (has an icon with arrows and a computer). Then you can have this as a oneDrive and write directly to it.

    0 讨论(0)
  • 2021-01-12 18:28

    Not the most elegant solution but if you're looking to save into a single library on SharePoint, you can first map that library as a drive on your local machine.

    Simply use setwd() to point to whatever drive letter you mapped the library to. You can then treat that Sharepoint library as if it were any other shared drive location, reading and writing files from/to it.

    0 讨论(0)
  • 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")
    
    0 讨论(0)
提交回复
热议问题