【问题标题】:Displaying an SP item attachment within a SharePoint web part using spfx使用 spfx 在 SharePoint Web 部件中显示 SP 项目附件
【发布时间】:2020-02-14 05:06:36
【问题描述】:

我正在开发一个 SharePoint Web 部件,它基本上是一个连接到 SPO 列表的表单。在表单中,我正在考虑为用户使用附件字段来附加单词或 pdf 文档。我可以在代码中使用什么来在表单中显示此附件的内容,或者以某种方式打印出文档的内容而无需打开文档?

【问题讨论】:

    标签: sharepoint sharepoint-online spfx


    【解决方案1】:

    您可以通过将文本附加到文档的 URL 来使用 SharePoint Online Office Web Apps。

    https://yourDomain/sites/yourSite/Lists/Tasks/Attachments/1/AdventureWorksBikes.xlsx?web=1
    

    或使用文档查看器页面的直接路径:

    https://yourDomain/sites/yourSite/sites/yourSite/_layouts/15/Doc.aspx?sourcedoc=/sites/yourSite/Lists/Tasks/Attachments/1/AdventureWorksBikes.xlsx&action=default&mobileredirect=true
    

    如果您想在现有页面中显示以上内容,可以将其放入 IFRAME。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-27
      • 1970-01-01
      • 2021-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-22
      • 2010-09-29
      相关资源
      最近更新 更多