英文:
How to download a file from a SharePoint though a website button?
问题
希望一切都好,
我有一个网页,上面有一个按钮和一个SharePoint库。
一旦用户点击下载按钮,文件将从SharePoint下载,并带有用户尝试下载此文件的水印。
此外,我需要管理谁可以访问或下载文件。
因此,需要考虑的主要要点包括:
-
用户对SharePoint文档库的身份验证
-
从网站本身提取文档
-
水印功能
因此,实现这一目标的最有效做法是什么,我应该使用什么?
提前感谢。
英文:
I hope all is well,
I have a webpage 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?
Thanks in advance
答案1
得分: 1
这是一个开放的但不够详细的问题,能提供更多的上下文吗?您使用的是什么编程语言?您是否已经尝试过一些方法,出现了什么问题?
目前,我能提供的唯一帮助是一些一般信息:
用户身份验证到SharePoint文档库
如果您正在扩展SharePoint或M365的SPFx解决方案,您无需担心身份验证问题。如果是完全独立的情况,我建议查看以下链接:
- https://learn.microsoft.com/en-us/graph/auth/auth-concepts
- 我强烈建议查看microsoft-graph-toolkit,其中包含mgt-login组件
https://learn.microsoft.com/en-us/graph/toolkit/components/login
同样,我还建议使用MS Graph和类似https://graph.microsoft.com/(版本)/sites/(站点ID)/drive/(驱动器ID)/items/(项目ID)/content
的终结点。我认为这与以下主题非常相似:https://stackoverflow.com/questions/61499357/sharepoint-graph-api-download-file-from-document-library-that-are-not-listed-as
水印功能
至于水印功能,我建议查看Microsoft 365的敏感标签功能,可以在这里详细了解:
希望这对您有所帮助。这绝对是一个良好的起点。
英文:
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/auth/auth-concepts
- I would strongly recommend checking microsoft-graph-toolkit there is a mgt-login component
> 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
- I guess this is a very similar topic: https://stackoverflow.com/questions/61499357/sharepoint-graph-api-download-file-from-document-library-that-are-not-listed-as
> 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 🙂
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论