If you put an ASPX file to a document library it will be downloaded when you click on it.
So, instead of the document library, you need to put your ASPX page to a different location. For example:
- Site Assets
- Styles Library
- Site Pages
If you put your HTML Page (with an aspx extension) to any of the above, it will open just fine.
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.