I am trying to upload file to sharepoint using python3.6. Some small files are getting uploaded, but few are not. Getting below error of timeout 3
raise ShareplumRequestError("Shareplum HTTP Post Failed", err)
shareplum.errors.ShareplumRequestError: Shareplum HTTP Post Failed : HTTPSConnectionPool(host='xyz.sharepoint.com', port=443): Read timed out. (read timeout=3)
Using below piece of code:
from shareplum import Site
from shareplum import Office365
from shareplum.site import Version
authcookie = Office365('https://xyz.sharepoint.com', username='abx@qwe.com', password='password').GetCookies()
site = Site('https://xyz.sharepoint.com/sites/abc', version=Version.v365, authcookie=authcookie)
filename=abc.csv
filepath1=/abc/xyz/
path1 = Path(file_path1)
if path1.is_file():
with open(path1, mode='rb' ) as file:
fileContent = file.read()
sub_folder1.upload_file(fileContent, file_name1)
print ("File : " + file_name1 + " Uploaded Successfully")
else:
print ("File : " + file_name1 + " Not present at location: " + file_path1)