Similar to this question I'm having trouble opening a file uploaded via Python onto SharePoint. This is the code I'm using to upload the file:
import requests
from requests_ntlm import HttpNtlmAuth
session = requests.Session()
session.auth = HttpNtlmAuth('DOMAIN\\username','password', session)
files = {'file': ('_test.xlsx', open('_test.xlsx','rb'),
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
{'Expires': '0'})
}
put_url = 'https://secure.sp.kp.org/teams/scpmgcc/complete%20care/Proactive%20Care/POE_CCTE_TAT/2017%20Reports'
myFile = requests.put('{}/_test.xlsx'.format(put_url),
files=files,
auth=session.auth)
The error message is below:
Is SharePoint doing anything to the upload? Should I be encoding the data somehow? Thank you for any assistance you can provide.