Search code examples
sharepointintegrationsharepoint-online

How to download a file from a SharePoint though a web site button?


I have a web page that has a button and a SharePoint library.

Once the user clicks the download button, the document will be downloaded from SharePoint with a watermark of the user trying to download this file.

Additionally, I need to manage who can access or download the file.

Therefore, the main points to consider are:

  • User authentication to the SharePoint document library

  • Pulling the document from the website itself

  • Watermark feature

Thus, what is the most effective practice to achieve that and what should I use?


Solution

  • oh man, this is really an open and not quite detailed question 😟. Could you provide more context? what language are you using? have you already tried something and what is failing?

    For now, the only help I may provide you is just general info 🙂:

    User authentication to the SharePoint document library

    if you are extending SharePoint or M365 with a SPFx solution you do not need to worry on auth. If it is totally aside I would recommend checking

    https://learn.microsoft.com/en-us/graph/toolkit/components/login

    again here I would also recommend using MS Graph and endpoint like https://graph.microsoft.com/(version)/sites/(site-id)/drive/(drive-id)/items/(item-id)/content

    Watermark feature

    as for this I would take a look at Microsoft 365 sensitivity labels feature and read more about it here

    I hope this will be of any help. For sure it is a good start 🙂