Google Drive: How do I share folders, so that individuals subfolders are not synced? - google-drive-api

How to share Google Drive folders and subfolders so that users can decide what to sync to their hard drive?

Google Drive's sync software (the one you install on your computer) only let's you decide which top level folders you want to sync. You cannot not sync subfolders alone.
You can however share folders in a way that allows your users to put them into the root folder directly. This way, they can unselect them individually for syncing.
Say you have the following folder structure
- Project [parent]
-- Planning files [subfolder 1]
-- Execution files [huge subfolder 2]
Instead of sharing the Project folder to a user, do individually share the Planning files and Execution files folder. This way, users can link both directly into their My Drive root folder.
In the sync client they're now top level folders and can be individually deselected.
If you would instead share the Project" folder, a user would need to "split up" the single share, to move e.g. "Execution files out of it. This breaks sharing of the latter for everyone.
By the way, Google Drive apparently seems to be able to have a single folder or file in two or more parent folders. This would also allow for a sharing concept. However, the new Google Drive interface, introduced in 2014 (?) hides this functionaliy. In the old Google Drive, you can use "Move to", then hold CMD/CTRL and selected more than one parent.

Good tip, but this doesn't work very well if your folder structure is like this:
- Projects
-- Project ABC
--- Planning Files
--- Execution Files
-- Project DEF
--- Planning Files
--- Execution Files
A solution might be the hidden feature of adding a folder to multiple parents. You can still do this in the new drive interface by selecting a folder and pressing SHIFT+z. Use that to add all Planning files to a Planning folder.

For those of you who want to sync only a subfolder not the whole folder with thing inside
here are the steps.
assuming you downloaded and installed drive.
go to you sub-folder you wish to sync to your computer.
click once on folder, so it turns blue.
press keys Shift then Z
a menu will pop up
don't choose a place to put since it only syncs main folders (put it in the drive not a folder)
on your COMPUTER right click on drive.
go to google drive with icon in front of it.
choose a the sub-folder you PUT in the DRIVE
reminder when you press Shift and Z it copies the folder, so any changes you do to shortcut folder that's in your DRIVE is updated to the drive on computer and inside sub-folder.

Related

Rename synched google drive on google only

I know that google drive depends on ID of folders/files not the name, so You can have multiple folders with same name.
In my Case I have multiple Unity3D projects where I always synch the assets folder, When I want to download on of my projects it takes me time to figure which assets folder on google drive belongs to my project.
Is there any way I can rename the folder on google drive while keeping it on local drive without changing?
Or any other options can help thanks
I suggests to add folder in each assets folder and name the file with your project name. Make it all capital and add "000" at the beginning of the folder name to make it at the top of the list for ease find

Google Drive API - Recovering the original folder for a file restored from trash before the original folder has been restored

Scenario
There are many files in a Google (Team) Drive, all of which are nested in folders
All of these folders and their files are deleted by mistake.
In an attempt to recover the data, the Restore button on the Web UI is used
The Restore button in the Web UI does not seem to care about the order, and restores files before restoring the folders that contained them.
Thousands of files end up in the root directory of the drive since their folders "don't exist" when being restored from Trash.
What I need:
How can I recover the information about where the files used to reside, in order to patch this correctly?
What I tried:
Get all of the revisions for one of the files in question with Revisions: list and see there is only 1 result.
Get the revision information for that revision with Revisions: get
Realise that the revision information contains nothing about parents.
Get the file information with Files: get
Confirm that the head revision meta matches the only revision found in step 1
See that the file meta shows the parent is the root.
I can't find a way of determining what the original folder was for the trashed and incorrectly restored file.
After further investigation I don't think it is possible to recover the information about the previous parents from the Google Drive API v3.
However, if you are using Google Team Drive, as part of the G Suite, you should have access to the G Suite Admin SDK Reports API unless you are on a G Suite Basic account. With that you can use Activities: list with various filters to pull back the information about where the orphaned files came from.
I have published my solution here: Google Team Drive Orphaned File Restorer
This console application can pull a list of Google Drive file movements between two points in time, optionally filtered by the IP Address of the user who made the changes (i.e. restored the files from trash). It will then use that information to re-parent the files in question. You can do a dry run to see what the changes will be before you actually commit.

User with edit privileges made files I own not viewable by me

I shared a folder containing files and subfolders with files with multiple users and gave them edit permissions. One users account has modified the viewing ability(?) of every file and subfolder they had access to. From my account when I open the top level folder I see it empty but I know these files are still there because I own the majority of them and my drive storage amount hasn't changed.
The user claims they have no idea how it happened so maybe that it was an app they unknowingly gave drive access to?
Is there any way I can fix this from the Google Drive web interface? I found Google Apps Scripts has access to the Drive API, should I find a script that can mass change the permissions?
Only the owner can delete the file.
The files were removed from the folder but were not deleted.
Therefore, they take up disk space.
To view files outside the folder, follow these steps:
https://drive.google.com/drive/search?q=is:unorganized%20owner:me
Excuse my bad English
Venca

DriveApp root Computers folder

Does anyone know how to easily access the Google Drive "Computers" folder that contains entries for each of a user's computers that was synced using the Google "Backup and Sync" application?
I've created a simple app script (more out of interest than anything else) which creates a Google Sheets document listing the contents of the current user's G-Drive. It starts with a call to DriveApp.getRootFolder(), and then lists and navigates the file tree from there. This all works fine, but it does not contain anything that is not a child of "My Drive", such as the Backup and Sync files stored under the "Computers" pseudo-root folder.
I've tried using DriveApp.getFoldersByName("Computers"), but that returned an iterator with zero items.
Not possible. You can only touch your regular "My Drive" (or team drive) files. No mention of that in Files: list.

google drive folder information

I would like to use Google Drive to push files in various folders onto a remote computer. I would like this to be a one-way transaction so the people using the computer cannot write to Google Drive.
However, when I use the following C# code to get the files from Google Docs I only get the file names, not their directories where they will be on the remote computer. This won't work because some files in different directories have the same name. Is there a way to programmatically get directory information from these files?
Alternately, if I could set up the Google Drive folder to be read-only, that would accomplish my goal and probably be easier. Can this be done?
You should use the Google Drive API to list all files and check the parents field of each of them to map those files into folders:
https://developers.google.com/drive/v2/reference/files#resource