google-picker

Prevent Google picker popup from blocking by browser

99封情书 提交于 2019-12-01 23:00:42
问题 I have implemented Google Picker in my website using javascript. But Whenever a button to initialize picker is pressed, it gets blocked by browser. I have searched and tried few solutions here like: Adding client.js instead of api.js Setting 'immediate' = false; But they are not working for me. Please help ! 回答1: I have found a solution for this, if the popup is fired from click event then browsers will not block it, so the main idea is to initiate once and afterward trigger the picker

Display only Team Drives in Drive Picker Widget

走远了吗. 提交于 2019-12-01 10:52:35
问题 I am creating an application where I need to provide Drive Picker widget so that users can upload some files. Now I want to restrict users so that they can only select files from their "Team Drives" and not from anywhere else. I've tried adding method in onPickerInit event. Here's my function which is getting called in onPickerInit event, function fetchFolder(widget, pickerBuilder) { pickerBuilder.addView(new google.picker.DocsView() .setParent('TeamDriveId') .setIncludeFolders(true)); } This

Opening specific MimeTypes with google picker

 ̄綄美尐妖づ 提交于 2019-12-01 09:22:14
I am working with realtime API and I am making use of realtime-client-utils. Using existing code, I am creating realtime files with this method: createRealtimeFile = function(title, callback) { gapi.client.load('drive', 'v2', function() { gapi.client.drive.files.insert({ 'resource': { mimeType: rtclient.REALTIME_MIMETYPE, title: title } }).execute(callback); }); } and then I am trying to open files with this picker: var popupOpen = function () { var token = gapi.auth.getToken().access_token; var view = new google.picker.View(google.picker.ViewId.DOCS); view.setMimeTypes(rtclient.REALTIME

How to make the file shareable using google drive api

感情迁移 提交于 2019-12-01 06:27:59
I am trying to get the file using google drive api, by default the file is not shareable i want to make it shareable. Here is my code:- <script type="text/javascript" src="https://apis.google.com/js/api.js"></script> <script src="https://apis.google.com/js/client.js"></script> // The Browser API key obtained from the Google Developers Console. // Replace with your own Browser API key, or your own key. var developerKey = 'XXXXXXXXXX_ff_NX66eb-XXXXXXXXXXX'; // The Client ID obtained from the Google Developers Console. Replace with your own Client ID. var clientId = "XXXXXXXXXX

Google picker and backend file download

雨燕双飞 提交于 2019-12-01 04:05:30
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 ask the user to grant me permission using oauth flow. I don't want to do that. If user has selected a

How to make the file shareable using google drive api

不想你离开。 提交于 2019-12-01 03:51:26
问题 I am trying to get the file using google drive api, by default the file is not shareable i want to make it shareable. Here is my code:- <script type="text/javascript" src="https://apis.google.com/js/api.js"></script> <script src="https://apis.google.com/js/client.js"></script> // The Browser API key obtained from the Google Developers Console. // Replace with your own Browser API key, or your own key. var developerKey = 'XXXXXXXXXX_ff_NX66eb-XXXXXXXXXXX'; // The Client ID obtained from the

How to show the Google Picker API dialog after user presses a button or an image?

自作多情 提交于 2019-11-30 16:32:56
is any HTML expert out there who can help me? I want to show the Google Picker API Dialog after the user clicks on a button or an image and I want to show the result on the page afterwards. It should be simple for developers who know how to do web programming. Sample code of how to use is in the link above. Big thanks. I now solved it myself. The main loader of Google Javascript APIs is the Google Loader. Look here at the documentation: http://code.google.com/intl/en/apis/loader/ Insert this code inside <head> ... </head> of the HTML (a Google Docs Picker). The main function for loading after

Cannot call Google Script API Functions from Web App (TypeError: Cannot read property 'run' of undefined)

北慕城南 提交于 2019-11-30 08:43:56
问题 I had a google apps script working fine for months and it suddenly stopped working. I'm wondering if Google deprecated some part of my code or something. This is the link to the file: Click here to view Google Spreadsheet File The google script code is apparently failing when trying to call a google script function from an HTML file. This is the line of code that fails. google.script.run.importCSVData(id); The lines fails and catches the following error: TypeError: Cannot read property 'run'

How to show the Google Picker API dialog after user presses a button or an image?

久未见 提交于 2019-11-29 23:50:20
问题 is any HTML expert out there who can help me? I want to show the Google Picker API Dialog after the user clicks on a button or an image and I want to show the result on the page afterwards. It should be simple for developers who know how to do web programming. Sample code of how to use is in the link above. Big thanks. 回答1: I now solved it myself. The main loader of Google Javascript APIs is the Google Loader. Look here at the documentation: http://code.google.com/intl/en/apis/loader/ Insert

Cannot call Google Script API Functions from Web App (TypeError: Cannot read property 'run' of undefined)

邮差的信 提交于 2019-11-29 07:26:18
I had a google apps script working fine for months and it suddenly stopped working. I'm wondering if Google deprecated some part of my code or something. This is the link to the file: Click here to view Google Spreadsheet File The google script code is apparently failing when trying to call a google script function from an HTML file. This is the line of code that fails. google.script.run.importCSVData(id); The lines fails and catches the following error: TypeError: Cannot read property 'run' of undefined Like I said, I had this code working fine for months and it suddenly stopped working. (FYI