google-drive-api

Unable to open Google xlsx spreadsheet / Also Google Drive permission Blocked

假如想象 提交于 2021-01-07 06:31:11
问题 I have a Google Apps Script that I am currently using to successfully open a Google Sheets spreadsheet (read-only shared with my account) and perform some reading functions. I received another spreadsheet that I would like to run similar processes on. If I try: SpreadsheetApp.openById("_______") (which works on the other sheet), I get Exception: Service Spreadsheets failed while accessing document with id _____" with this sheet. This spreadsheet is actually an xlsx on Google Drive (but

Getting permission denied error while uploading image on Google Drive by Google Drive API Javascript

荒凉一梦 提交于 2021-01-07 02:45:39
问题 This is the code to upload image on my Google Drive, then get the url and delete if needed and it was working perfectly. function uploadImageInFolderAndGetVisibleDocURL(imgName, url) { return new Promise(function(resolve, reject) { const fileName = imgName; var folderId = '01220GsMOG727b2TxnSB_7zkgAFcygd'; fetch(url).then(res => res.blob()).then(blob => { const form = new FormData(); form.append('metadata', new Blob([JSON.stringify({name: fileName, parents: [folderId]})], {type: 'application

ReferenceError: “Drive” is not defined

与世无争的帅哥 提交于 2021-01-07 02:44:32
问题 In Google App Maker, I am writing a function in ServerScript that will convert a user-uploaded Excel spreadsheet to Google spreadsheet. I am using this piece of code (https://stackoverflow.com/a/35597644/9878092), but I am getting ReferenceError: "Drive" is not defined. I tried using the line of code that I got directly from the link: file = Drive.Files.insert(file, xlsxBlob, { and my own edited version: file = Drive.Files.update(file, ssFileID, xlsxBlob, { Where ssFileID is the file id of

ReferenceError: “Drive” is not defined

旧巷老猫 提交于 2021-01-07 02:43:46
问题 In Google App Maker, I am writing a function in ServerScript that will convert a user-uploaded Excel spreadsheet to Google spreadsheet. I am using this piece of code (https://stackoverflow.com/a/35597644/9878092), but I am getting ReferenceError: "Drive" is not defined. I tried using the line of code that I got directly from the link: file = Drive.Files.insert(file, xlsxBlob, { and my own edited version: file = Drive.Files.update(file, ssFileID, xlsxBlob, { Where ssFileID is the file id of

Cannot retrieve the next object: iterator has reached the end error when iterating over shared Drive

馋奶兔 提交于 2021-01-04 05:35:38
问题 Folder sharing does not work on Google Shared Drive, so I am trying to automate sharing through Google Apps Script. I tried to write code with reference to several examples, but I kept getting errors and asked questions. I got an error saying: 'Cannot retrieve the next object: iterator has reached the end', and I confirmed that sharing of some files was not set. Below is the code I wrote. How can I fix this problem? function myFunction() { var folderid = "" var folder = DriveApp.getFolderById

How do I use Google Picker to access files using the “drive.file” scope?

久未见 提交于 2021-01-02 05:56:30
问题 My Google Drive-integrated web application works fine with the drive scope, but using such a broad scope is bad practice unless necessary. I would like to restrict the scope to drive.file so that I can only access files created by the application and files opened using Google Picker, but I cannot get it to work. Files created by the application can be opened without problem. Files opened using Google Picker, however, are not accessible; attempting to download such a file results in a 404

Is it possible to open google picker with access token which is fetched from server side Oauth2?

ε祈祈猫儿з 提交于 2021-01-01 07:04:47
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });

Is it possible to open google picker with access token which is fetched from server side Oauth2?

风格不统一 提交于 2021-01-01 07:03:53
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });

Is it possible to open google picker with access token which is fetched from server side Oauth2?

岁酱吖の 提交于 2021-01-01 07:03:41
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });

Is it possible to open google picker with access token which is fetched from server side Oauth2?

吃可爱长大的小学妹 提交于 2021-01-01 07:03:29
问题 I have integrated my Google drive using Oauth2 in server side and stored credentials like access token and refresh token in data base. const clientId = `${process.env.GOOGLE_DRIVE_CLIENT_ID}`; const clientSecret = `${process.env.GOOGLE_DRIVE_CLIENT_SECRET}`; const redirectURI = `${process.env.SERVERHOST}/connect/gdrive`; const oAuth2Client = new google.auth.OAuth2( clientId, clientSecret, redirectURI, ); const authUrl = oAuth2Client.generateAuthUrl({ access_type: "offline", scope: SCOPE, });