【问题标题】:Accessing file using fileget url使用 fileget url 访问文件
【发布时间】:2018-05-08 02:09:38
【问题描述】:

我正在尝试创建使用提供商托管应用程序打开自定义文件的文件处理程序插件。

我在 heroku 中托管了应用程序,到目前为止,当我从共享点打开文件时,我的应用程序中的请求正文如下所示。

{
  resourceid: "https://{tenant}.sharepoint.com",
  culturename: "en-US",
  fileget: "https://{tenant}.sharepoint.com/_vti_bin/wopi.ashx/files/{fileid}/contents?access_token={token}",
  fileput: "https://{tenant}.sharepoint.com/_vti_bin/wopi.ashx/files/{fileid}/contents?access_token={token}",
  fileid: "{fileid}",
  client: "SharePoint"
}

但是当我请求使用fileget url 获取文件内容时。它会引发 500 错误消息 The URL is invalid for the current user or application.

访问文件内容的方式可能是什么。

【问题讨论】:

    标签: node.js sharepoint filehandler ms-wopi


    【解决方案1】:

    网址似乎是正确的。 您可以通过请求CheckFileInfo 来查看file's URL properties

    例子:

    GET https://{tenant}.sharepoint.com/_vti_bin/wopi.ashx/files/{fileid}?access_token={token}
    

    看看DownloadUrlFileUrl。如果设置了任何属性,请使用它们下载文件。

    【讨论】:

    • 嗨洛基,当我向上述网址发送请求时。它抛出和错误。 {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."}。我正在使用邮递员
    • 您可能必须使用您的 WOPI 客户端实例的 discovery XML file 编写自己的 URL。它可能与上面的略有不同。确保您拥有正确的端点(= 正确的应用名称,正确的操作)。另外,您是否也按照我的建议尝试查看 DownloadUrl 和 FileUrl?
    • 除了上面写的以外,我没有得到任何其他属性。我对 sharepoint 很陌生,无法得到你实际指出的内容。我正在关注文件处理程序文档,并且应该按照here 的描述获取激活参数
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-20
    • 1970-01-01
    • 2012-05-09
    • 2019-12-28
    • 2011-06-21
    • 2021-03-10
    相关资源
    最近更新 更多