moya-a / g-drive-sharedfiles-checker Goto Github PK
View Code? Open in Web Editor NEWCheck your GoogleDrive to find all your shared files
License: MIT License
Check your GoogleDrive to find all your shared files
License: MIT License
Hi,
The problem of "Exception: The file or folder has invalid access settings." can be very strange.
Your current approach attempts to collect every file's permission within a list called resultFiles
before writing to a google sheet. Due to this any errors encountered during a particular folder or a file cannot be debugged easily. Any successfully evaluated folders and files are lost.
It would be worthwhile to instead append each row to the sheet. This would also prevent any timeout errors and internet connection problems while spooling resultFiles
.
Please have a look at appendRow
function of this gist that recursively goes through folders and subfolders - https://gist.github.com/JavierCane/28f7307ceeaf6464431c1418b598a817
Google changed the access permission methods at some point in the past. Prior to that a complex set of link sharing options could be assigned to a file or a folder. So some files and folders in a drive can have those older settings for access sharing and permissions, which are not a part of the current API.
In one of the folders that had this exception I found multiple share link settings in its share menu. I manually found that using the GUI after using the following code.
function start() {
var folders = DriveApp.searchFolders('not "me" in owners');
while (folders.hasNext()) {
var folder = folders.next();
try {
if (folder.getSharingAccess() === DriveApp.Access.ANYONE) {
Logger.log(folder.getName());
}
}
catch(err) {
Logger.log(folder.getName());
Logger.log(err);
}
}
}
Please let me know if you are able to come up with a way to append each row to a sheet instead of collecting each row in a list. I wasn't able to do it myself to submit a pull request or a fork because I don't understand the logic for comparing the sharing access strings and sharing permissions strings in your current method.
Thank you.
thx!
I get this after 6 mins of waiting. I have run it twice now... Any ideas on how to fix?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.