I have a Python script that saves a file to a server shared folder for a user to access. Our organization recently moved our server file structure to Sharepoint... including all the folders. (I've read multiple articles that's a bad idea, but there's no changing it right now.)
I have new code that uploads a file to the root folder of the Sharepoint library:
import sharepy s = sharepy.connect("site.sharepoint.com", "username", "password") r = s.post("https://site.sharepoint.com/_api/web/Lists/GetByTitle('Documents')/RootFolder/files\ /add(overwrite=true,url='test.csv')", \ "testing,foo,bar") print(r)
Is there a way to upload the file to a subfolder instead of the root? If so, how?
