简体   繁体   English

使用 Python 将 Excel 文件上传到 Sharepoint

[英]Upload Excel file to Sharepoint using Python

from shareplum import Site
from shareplum import Office365
from shareplum.site import Version

authcookie = Office365('https://********.sharepoint.com/', username='dhruvpanchal@******.onmicrosoft.com', password='********').GetCookies()
site = Site('https://******.sharepoint.com/sites/BorakayInternal', version=Version.v2019, authcookie=authcookie)
folder = site.Folder('Shared Documents/This Folder')
folder.upload_folder('ConsolidatedTimesheet.xlsx')

In this code i get error:-在这段代码中我得到错误: -

folder.upload_folder('ConsolidatedTimesheet.xlsx')
AttributeError: '_Folder' object has no attribute 'upload_folder'

Can anyone help me solve this?谁能帮我解决这个问题?

I notice that you specified a file as the parameter while the function is 'upload_folder'.我注意到您指定了一个文件作为参数,而 function 是“upload_folder”。 I check the official docs of shareplum , should it be the following method?我查看了shareplum的官方文档,应该是以下方法吗?

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM