Upload Excel file to Sharepoint using Python

Viewed 1283
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 ?

1 Answers

I notice that you specified a file as the parameter while the function is 'upload_folder'. I check the official docs of shareplum, should it be the following method?

enter image description here

Related