Hi @totally_gizmo,
I'm glad to hear that you solved the problem and thanks for your sharing. If you have any issue about SharePoint, you are welcome to raise a ticket in this forum.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others." and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
[Cannot upload .aspx file to Sharepoint Site Pages using Microsoft Graph]
Issue Symptom:
Related Question (not answered): https://social.msdn.microsoft.com/Forums/en-US/b45a6cee-cc09-4820-9667-0af97f3030c4/cannot-upload-aspx-file?forum=sharepointdevelopment
Currently unable to upload .aspx
files to the Site Page
using Microsoft Graph. It doesn't matter if the file is empty or if it is a file with the content. Site Pages is a specific drive
within the Site directory. Which mirrors the response above. If the file is named, .asp
or any other ending for that matter, the file is able to be uploaded. This leads me to believe this is not a matter of permissions within the Azure portal.
Similar problems are experienced when trying to update template files within _catalogs/theme
within Graph.
Solutions:
Newly released within Microsoft Graph Beta API, there is the Site Page API that allows for the creation of a .aspx
file.
It is a 2 part process.
- Create the page via
POST /sites/{site-id}/pages
, which returns the newly created site Page. - Publish the new page -->
POST /sites/{siteId}/pages/{pageId}/publish
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.