0
<html>
  <head>


    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">\
    <script type="text/javascript" src="https://apis.google.com/js/api.js"></script>
    <script type="text/javascript">

        init = function() {
        s = new gapi.drive.share.ShareClient('<YOUR_APP_ID>');

//在JS中获取file-id的方法是什么。我想把文件分享给不同的用户 s.setItemIds([""]); }

    window.onload = function() {

        gapi.load('drive-share', init);

    }


    </script>

  </head>

  <body>


      <button onclick="s.showSettingsDialog()">Share</button>

//showSettingDialog() 是如何工作的

  </body>
</html>
4

1 回答 1

1

您应该首先使用Files.list()。您可能想尝试此页面上的各种语言的快速入门代码。

然后,您将看到文件资源列表。文件资源中的属性“id”是您想要的文件 id。

或者,如果您正在处理特定的 Google Docs 文件,您可以在 URL 中看到文件 ID。

于 2013-06-06T15:38:22.440 回答