google-picker

Google Drive API Application data accessing credentials from Web browser(Javascript)

人走茶凉 提交于 2019-12-05 00:54:31
问题 I'm trying to obtain credentials from Google Console to access my Application Drive data through Web browser(Javascript) option (In order to use Picker API latter on). But when I select option Application data(Access data belonging to your own application) I got the message: Application data cannot be accessed securely from a web browser. Please consider selecting another platform. Can anyone explain, why It is not secure, and how can I access my application data using Web browser, maybe

Show google picker inside/over modal

左心房为你撑大大i 提交于 2019-12-04 11:28:38
问题 Is there a way to show the google drive picker to be shown inside a custom modal or a div? I have a modal where there will be multiple providers user can choose e.g. google, dropbox. That modal contains all the js and css files in it. So when I click on google drive the picker iframe is embedded into body and behind my modal, although my modal z-index is 1030 and picker iframe zindex is 2292. 回答1: I solved this problem by setting the google picker container on front using following code : var

Download file from Google Picker API in rails

本秂侑毒 提交于 2019-12-04 04:52:49
问题 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: "https://drive.google.com/uc?export=download&id="+fileid I'm using rails version 3.2 Any helps would be much appreciated. Thanks. 回答1: You'll need to send headers with the GET request:

Google picker and backend file download

雨燕双飞 提交于 2019-12-04 00:59:49
问题 I'm using google picker in my web app to allow user to browse and select files from his google drive. Once he makes the selection, picker returns various data about selected files, including file ID and URL. My goal is to download the selected files to the server. If I pass the URL to my backend script, it won't be able to download a file that is private. I know I could probably use the provided file ID to access the file via Drive API, but I need an access token for that, so I would need to

Google API error, but still works

陌路散爱 提交于 2019-12-03 22:06:26
Im getting this console error on my localhost when connecting to google drive API, but the picker I have configured in my script successfully displays my drive's contents: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided (' https://docs.google.com ') does not match the recipient window's origin (' http://localhost:8000 '). Invalid 'X-Frame-Options' header encountered when loading ' https://docs.google.com/picker?protocol=gadgets&origin=http%3A%2F%2Flocalho …2photos%22))&rpctoken=yxxydsx40r21&rpcService=2dngvfb4tj9x&thirdParty=true': 'ALLOW-FROM http://localhost:8000 '

Google Drive API Application data accessing credentials from Web browser(Javascript)

拟墨画扇 提交于 2019-12-03 17:27:25
I'm trying to obtain credentials from Google Console to access my Application Drive data through Web browser(Javascript) option (In order to use Picker API latter on). But when I select option Application data(Access data belonging to your own application) I got the message: Application data cannot be accessed securely from a web browser. Please consider selecting another platform. Can anyone explain, why It is not secure, and how can I access my application data using Web browser, maybe should choose different credentials? Thanks. You can access your Google Drive Data in three possible ways:

Show google picker inside/over modal

 ̄綄美尐妖づ 提交于 2019-12-03 07:30:23
Is there a way to show the google drive picker to be shown inside a custom modal or a div? I have a modal where there will be multiple providers user can choose e.g. google, dropbox. That modal contains all the js and css files in it. So when I click on google drive the picker iframe is embedded into body and behind my modal, although my modal z-index is 1030 and picker iframe zindex is 2292. I solved this problem by setting the google picker container on front using following code : var picker = new google.picker.PickerBuilder() .enableFeature(google.picker.Feature.NAV_HIDDEN) .enableFeature

Download Google Drive file using javascript

江枫思渺然 提交于 2019-12-02 18:31:30
问题 I want to download Google Drive file using javascript to my server when i click on Google Drive picker but cannot get the file downloaded. I have been searching if for 4 days but the issue is same below is the code that i am using. function pickerCallback(data) { if (data.action == google.picker.Action.PICKED) { var id = data.docs[0].id; var request = new XMLHttpRequest(); request.open('GET', 'https://www.googleapis.com/drive/v2/files/' + id); request.setRequestHeader('Authorization', 'Bearer

Download Google Drive file using javascript

空扰寡人 提交于 2019-12-02 10:37:36
I want to download Google Drive file using javascript to my server when i click on Google Drive picker but cannot get the file downloaded. I have been searching if for 4 days but the issue is same below is the code that i am using. function pickerCallback(data) { if (data.action == google.picker.Action.PICKED) { var id = data.docs[0].id; var request = new XMLHttpRequest(); request.open('GET', 'https://www.googleapis.com/drive/v2/files/' + id); request.setRequestHeader('Authorization', 'Bearer ' + gapi.auth.getToken().access_token); request.addEventListener('load', function() { var item = JSON

Download file from Google Picker API in rails

雨燕双飞 提交于 2019-12-02 02:33:49
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: "https://drive.google.com/uc?export=download&id="+fileid I'm using rails version 3.2 Any helps would be much appreciated. Thanks. You'll need to send headers with the GET request: Authorization: Bearer [token] Where token is gapi.auth.getToken().access_token and gapi is defined at: gapi