问题标签 [google-picker]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
4079 浏览

css - 在模式内部/上方显示谷歌选择器

有没有办法让谷歌驱动器选择器显示在自定义模式或 div 中?我有一个模式,用户可以选择多个提供商,例如谷歌、保管箱。该模式包含其中的所有 js 和 css 文件。所以当我点击谷歌驱动器时,选择器iframe嵌入到body我的模态中和后面,尽管我的模态 z-index 是 1030 并且选择器iframezindex 是 2292。

在此处输入图像描述

0 投票
2 回答
3723 浏览

google-drive-api - 从谷歌选择器选择文件后立即下载文件

我只是想实现 Google Drive Picker API,以便下载用户通过 Google Drive Picker 提交的文件(在后台)。

我做了谷歌选择器,它工作得很好,但是我就是无法下载文件。(首先从单个文件开始)。

这是我的代码,在我的梦想中,我可以在获取选择器的文件后立即下载文件。

请注意,我想下载照片,但我无权访问“downloadUrl”字段。Google Drive Picker 和 Drive API 在我的应用程序上处于“开启”状态。

一切正常,除了我无法下载检索文件。

0 投票
1 回答
260 浏览

google-drive-api - Google File Picker loading wrong documents when signed into multiple accounts

We have the following scenario:

  • User logs into Google Drive with Account A
  • Then, user adds a new account and logs into Google Drive with Account B (two active valid accounts at this point)
  • While in Account B, the user clicks the Create button in Drive. Our app requests the user to select which account he wants to use for the file creation and the user selects Account B (same one he was already using). Our app shows the file picker but the files he gets to see are the ones in the Account A, not in Account B.

We have followed all the steps indicated in the developers API guide, including setting the authorization token. Here is our createPicker function:

and this is how we are obtaining the oauthToken value:

While debugging, we have confirmed that, if the user selects Account A, we get one oAuthToken, and if the user selects Account B, we get a different one. So we are sending different tokens for each account, as it is supposed to be.

Any idea on why the user, after selecting Account B (which generates a token for Account B) gets to see the files on Account A? Any idea of what are we missing or doing wrong?

0 投票
3 回答
1413 浏览

javascript - Download file from Google Picker API in rails

I've used Google Picker API to select a file from user's Google drive. I've all the metadata about the file which is returned by this API. But I'm stuck at how to download this file on my server.

Using the following link to download the file only downloads some files properly while the others are corrupted:

I'm using rails version 3.2

Any helps would be much appreciated. Thanks.

0 投票
1 回答
594 浏览

javascript - 谷歌选择器 api 没有进入 onApiLoad 函数

我想在我的应用程序中集成 Google 驱动器选择器 api。但是 google picker api 的 onload 函数没有调用。下面是我的代码。

上面的 .cshtml 页面会在点击页面中的按钮时被调用

控制器代码

GoogleApi.cshmtl 页面正在加载,但没有调用 ononApiLoad函数。我已将 GooglePickerApi 设置为 On。任何人都可以知道这有什么问题。

0 投票
1 回答
1645 浏览

javascript - window.location 选择 IP 地址而不是域名

我将我的 ruby​​ on rails 网站注册为 godaddy.com 下的子域

它工作正常。但是当我尝试获取 window.location.host 时,它返回的是我的服务器的 IP 地址,而不是域名。

因此,我的 google picker js api 出现以下错误:

任何人都可以帮忙吗?

0 投票
0 回答
3208 浏览

php - 使用php将文件从google drive api下载到我的服务器

1 - 我已经配置了谷歌选择器,它工作正常,我从选择器中选择文件并获取文件 ID。

2 - 在刷新令牌等所有过程之后,我获取文件元数据并获取文件导出链接

3 - 之后我使用这个

并得到这个回应

4 - 我使用一些 cURL 函数从谷歌驱动器获取文件并将其保存到服务器。在服务器目录中创建但已裁剪的文件。我使用此代码

当我将此 url 放入浏览器时,它将成功下载文件,但是当我使用此 url 使用 cURL 或任何 php 代码获取文件并尝试将其保存在服务器上时,它会保存损坏的文件。

它导致存储在服务器上的文件损坏,但是当我使用此代码获取除谷歌驱动器以外的任何文件时,我在服务器上成功下载了它。

任何人都可以帮助如何使用 php 将文件从 $downloadUrl 下载到我的服务器吗?

0 投票
1 回答
1337 浏览

javascript - Google Picker API DocsUploadView setIncludeFolders 不起作用

我有以下内容:

在此过程中,它不会询问目的地,它只是上传到根目录,并在文件上传完成后关闭对话框。

0 投票
1 回答
867 浏览

javascript - Google Picker 无法始终加载预览图像

我已经设置了一个 Google Docs Picker 以允许用户从 Google Drive 中选择图像或上传它们。

加载选择器后,网格视图中的某些图像预览不会加载。这似乎是随机的,错误是 404(未找到)。为https://googledrive.com/thumb/fileId?access_token=ya....&size=180格式的 url 返回 404

这是我可以在我的 JavaScript 代码中解决的问题吗?请参阅下面的代码。

提前致谢。

0 投票
2 回答
862 浏览

javascript - 用于 Google Drive Picker API 的 Polymer HTML5 Web 组件 - 目标来源错误

所以我试图启动对 Google Picker API 的 API 调用,我可以连接我的帐户,但之后它说我的 API 密钥无效。

API 和客户端编号与在我的 Google 开发人员控制台中找到的完全相同,并且 API 是为 Web 浏览器应用程序创建的。

这是在控制台中:

无法在“DOMWindow”上执行“postMessage”:提供的目标来源(“ https://docs.google.com ”)与收件人窗口的来源(“ http://w1nz.co ”)不匹配。

未捕获的 ReferenceError:未定义 init

我已经跟踪到 PickerBuilder.build()在线时发生的此错误。

您可以在http://w1nz.co/polymer-app/上实时查看


这是一个 Polymer HTML5 Web 组件,因此<template>标签内的任何内容都会呈现到页面。

我的代码: