Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #3

Open
g-r3m opened this issue May 17, 2019 · 2 comments
Open

Error #3

g-r3m opened this issue May 17, 2019 · 2 comments

Comments

@g-r3m
Copy link

g-r3m commented May 17, 2019

Hi,

I have an issue when I follow your Tutorial :
My error is : 'Refused to get unsafe header "location"' at xhr.onload, line 41.
The message " Error: <TITLE>Not Implemented</TITLE>

Not Implemented

Error 501

" is displayed on the HTML page.

Is your example still working on your side ?

@tanaikech
Copy link
Owner

Thank you for your comment. I noticed that the specification of Google Apps Script. This script uses a scope of https://www.googleapis.com/auth/drive. When the code of DriveApp.getFiles() is put in the script, the script editor automatically detects the scope of https://www.googleapis.com/auth/drive before. But now, When the code of DriveApp.getFiles() is put in the script, the script editor detects as https://www.googleapis.com/auth/drive.readonly. By this, when the script is run, such error occurs.

In this modification, in order to make the script editor detect the scope of https://www.googleapis.com/auth/drive, I put the code DriveApp.createFile() instead of DriveApp.getFiles() as a comment line. By this, I could confirm the script worked fine.

You can see the modified script at here.

About this, could you please confirm it?

@nikescar1
Copy link

Hi,

I've tried your suggestion but I still get the same error as the poster above. I've also tried adding DriveApp.createFolder.

function getAuth() { // DriveApp.createFile(); // DriveApp.createFolder(); return ScriptApp.getOAuthToken(); }

If I remove the parents line from the xhr.send then it works fine but then uploaded files aren't sent to a folder just the Google Drive root location.

xhr.send(JSON.stringify({ mimeType: fileType, name: fileName, parents: ['ReceivedFiles'] // <--- Please set the folder ID. }));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants