微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何获取 wopi 主机集成的 file_id?

如何解决如何获取 wopi 主机集成的 file_id?

我已经部署了文档中提到的 Wopi 客户端,现在我正在尝试部署 wopi 主机,但我是 .net 环境的新手,我不知道如何在 wopi 中托管文件-docs 文件夹。 (好像是加密的,但是不知道怎么获取那个文件夹里的文件

我已经完成了接下来的步骤:

  1. 我根据 the official documentation.(Wopi 客户端)实现了一个办公室在线服务器
  2. 我尝试了发现 URL,它运行良好。
  3. 我根据 this repo. 部署了一个 wopi 主机(顺便说一下,Wopi 主机和一个很棒的存储库)
  4. 在服务器中克隆了存储库。
  5. 我从根目录中的解决方from command line删除了 Cobalt 项目。
  6. 我在根目录中rebuilt解决方from command line
  7. 我从 WopiHost 目录中的命令行ran WopiHost 项目。
  8. 我从 WopiHost.Web 目录中的命令行 ran WopiHost.Web 项目。
  9. 我尝试将 Wopi 与 wopi host page 集成(我不知道它是否正确,但至少它似乎部分起作用),如下所示:
<!doctype html>
<html>

<head>
    <Meta charset="utf-8">

    <!-- Enable IE Standards mode -->
    <Meta http-equiv="x-ua-compatible" content="ie=edge">

    <title></title>
    <Meta name="description" content="">
    <Meta name="viewport"
        content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">

    <link rel="shortcut icon" href="https://my-server-url.com/wv/resources/1033/FavIcon_Word.ico" />

    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
            overflow: hidden;
            -ms-content-zooming: none;
        }

        #office_frame {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: 0;
            border: none;
            display: block;
        }
    </style>
</head>

<body>

    <form id="office_form" name="office_form" target="office_frame" action="https://my-server-url.com/wv/wordviewerframe.aspx?ui=es-mx&rs=es-mx&dchat=1&showpagestats=1&IsLicensedUser=1&WOPISrc=http%3A%2F%2Fmy-server-url.com%3A5000%2Fwopi%2Ffiles%2Ftest.docx" method="post">
        <input name="access_token" value="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxMjM0NSIsInVuaXF1ZV9uYW1lIjoiQW5vbnltb3VzIiwiZW1haWwiOiJhbm9ueW1vdXNAZG9tYWluLnRsZCIsIlVzZXJQZXJtaXNzaW9ucyI6IlVzZXJDYW5BdHRlbmQsIFVzZXJDYW5QcmVzZW50LCBVc2VyQ2FuUmVuYW1lLCBVc2VyQ2FuV3JpdGUiLCJuYmYiOjE2MTA2MDU5NDgsImV4cCI6MTYxMDYwOTU0OCwiaWF0IjoxNjEwNjA1OTQ4fQ.KbxGcTVOa3yWCGcEHEGv9MRP_NskfViW_vyMTOupRO4" type="hidden" />
        <input name="access_token_ttl" value="0" type="hidden" />
    </form>

    <span id="frameholder"></span>

    <script type="text/javascript">
        var frameholder = document.getElementById('frameholder');
        var office_frame = document.createElement('iframe');
        office_frame.name = 'office_frame';
        office_frame.id = 'office_frame';

        // The title should be set for accessibility
        office_frame.title = 'Office Frame';

        // This attribute allows true fullscreen mode in slideshow view
        // when using PowerPoint's 'view' action.
        office_frame.setAttribute('allowfullscreen','true');

        // The sandBox attribute is needed to allow automatic redirection to the O365 sign-in page in the business user flow
        office_frame.setAttribute('sandBox','allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation allow-popups-to-escape-sandBox');
        frameholder.appendChild(office_frame);

        document.getElementById('office_form').submit();
    </script>

</body>

</html>

我得到的结果是以下错误

enter image description here

有谁知道如何获取文件的正确名称以放入上面的 html 文件或如何获取 wopi 主机网络?

提前致谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。