如何通过网站按钮从 SharePoint 下载文件?

huangapple go评论64阅读模式
英文:

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/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/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 🙂

huangapple
  • 本文由 发表于 2023年2月14日 00:19:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75438536.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定