2023 Jan 26 4:27 AM
I am new to SharePoint. I have written a simple python script that basically connects to SharePoint and uploads files (aspx and other frontend files) from a folder on my local machine to a specific folder on the SharePoint site. Related to SharePoint this topic is discussed in the python course.
To facilitate the script to communicate with SharePoint, I have created an App principal under SharePoint using the SharePoint App-Only model.
Then, I have provided the below permissions to the App principal through 'appinv.aspx',
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl"/>
</AppPermissionRequests>
The script can successfully authenticate itself and also upload the files to the folder on SharePoint. But then when I manually go to the SharePoint folder and click on the aspx file, example: index. aspx; the file gets downloaded instead of getting rendered.
There is no issue with the file i.e. it is not corrupted because when I manually upload the same file onto the same folder, then there is no issue, the file gets rendered.
In regards to the permissions for the App prprincipalI've already given 'FullControl' at the scope 'sisite collectioneb' level. I also tried changing the scope from 'http://sharepoint/content/sitecollection/web' to 'http://sharepoint/content/sitecollection', this didn't work as well
Please can somebody help me with this?