我正在尝试从R上传文件到SharePoint。我找到了类似的问题,如从R保存文件到SharePoint文件夹、使用R将文件保存到SharePoint 和 在R中将文件复制到SharePoint库,但我自己还没有成功。
请注意,我们的SharePoint是使用荷兰语,因此文件夹“Shared documents”在荷兰语中为“Gedeelde documenten”。我尝试了两种语言,但没有成功。不确定我是否应该使用英文名称还是荷兰语名称。
我的猜测是我使用的URL格式不正确,所以我尝试了一些调整,但无法自行找到正确的方法。 非常感谢任何帮助。
编辑: 以下是Sharepoint页面和文件夹的样子。 完整的URL(我猜测从/Forms到结尾的部分不需要在命令中):https://companyname.sharepoint.com/sites/SiteName/Gedeelde%20documenten/Forms/AllItems.aspx?id=%2Fsites%2FOfficeSFMT%2FGedeelde%20documenten%2FGeneral%2FTest 文件夹的截图:
我的最佳猜测是尝试:
我尝试过的事情:
system("curl --ntlm --user username:password --upload-file file.xslx https://companyname.sharepoint.com/sites/sitename/Shared%20documents/file.xlsx")
system("curl --ntlm --user username:password --upload-file file.xslx https://companyname.sharepoint.com/sites/sitename/Documents/file.xlsx")
system("curl --ntlm --user username:password --upload-file file.xslx https://companyname.sharepoint.com/sites/sitename/Shared documents/file.xlsx")
system("curl --ntlm --user username:password --upload-file file.xslx \\\\companyname.sharepoint.com@SSL\\sites\\sitename\\Shared%20documents\\file.xlsx")
请注意,我们的SharePoint是使用荷兰语,因此文件夹“Shared documents”在荷兰语中为“Gedeelde documenten”。我尝试了两种语言,但没有成功。不确定我是否应该使用英文名称还是荷兰语名称。
我的猜测是我使用的URL格式不正确,所以我尝试了一些调整,但无法自行找到正确的方法。 非常感谢任何帮助。
编辑: 以下是Sharepoint页面和文件夹的样子。 完整的URL(我猜测从/Forms到结尾的部分不需要在命令中):https://companyname.sharepoint.com/sites/SiteName/Gedeelde%20documenten/Forms/AllItems.aspx?id=%2Fsites%2FOfficeSFMT%2FGedeelde%20documenten%2FGeneral%2FTest 文件夹的截图:
![foldernames](https://istack.dev59.com/RTiCu.webp)
"--upload-file C:/Users/UserName/Documents/Test.txt", "companyname.sharepoint.com/sites/SiteName/Documenten/General/Test/Test.txt"