Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to render aspx files when uploaded to SharePoint programmatically

former_member838817
Discoverer
0 Kudos
188

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?

0 REPLIES 0