How multiple users in a Web Application can access the single Google Drive using Google API - google-drive-api

I have a web application which will create users. And I have a single Google Drive. Once a user is create a folder will be assigned to that user in that Google Drive. That user can access only the folder allocated. Every time the user logs in from the web application the files within the allocated folder are able to view and the user can also upload and download files to that folder only. How this is achieved using Google API.

To start with you are going to need a create a service account for your application. The application will own the google drive account.
https://developers.google.com/accounts/docs/OAuth2#serviceaccount
Then your application is going to have to create the directory for the new user and associate the user with the directory's fileid (remember directorys are just files in google drive) the directory name could change so save the file id not the directory name to be sure.
Then it should simple be a matter of your appilcation uploading / viewing the files to the correct directory depending upon who is loged in. Since you will have the id for the directory it will be easy enough to list them the files already in that directory. as well as uploading directly to that directory.

Related

Can I make Google Drive available on my home network as a network drive?

Can I create a connection on one computer or device that exposes my drive to the rest of my network as a network shared drive?
My specific use case is that I have an older scanner that is connected to my wife that scans files and can send them to an email address, or to a network shared location. I’m trying to get it to send files directly to my Google drive though. Is there any way I can have computer connect to drive that lets the rest of the network see it as a shared drive?
Google Drive integration into Windows means that there will be some folder that acts as the Google Drive drop folder.
That folder, typically under your Documents folder can be Shared:
Right-click
Properties
Sharing tab
Click Advanced Sharing
Check Share this folder
Click Permissions
Grant Everyone the Change permission
Good question, totally fits StackOverflow, and definitely shouldn't be closed.

Building cloud service using python google drive API

Hi i'm trying to make my own cloud web service that uses python google drive API.
what i'm trying to make is basically cloud service but can also interact with Google Drive.
To do that, my web service users have to have their own 'storage.json' file in their server's virtual directory (which really stores in server).
when I somehow get my own 'storage.json' file, (I followd: https://developers.google.com/drive/api/v3/manage-uploads)
and upload 'storage.json' file to my directory like User1, upload and download with Google drive works just fine.
but my final goal is when my user doesn't have 'storage.json' file in their directory like User2, I want browser to pops up in User2's computer and User2 can follow the google's authentication flow and finally download 'storage.json' file into server's ~/User2/ directory.
Do you think this is possible? or if there are better ways, can you notice me? thank you

Change the structure of local google drive folder

If I change the structure of folder inside local Google Drive folder
does the changes be uploaded to the Google Drive online?
I understand that you are using Backup and Sync and have chosen a folder on your system to store and synchronize folders and files within your unit (My Drive).
By default, all changes you make to your local folder are synchronized with your online drive, i.e. if you move files between folders, or create or delete anything, the change will be reflected. It is a bidirectional behavior, if you want more information about how this system works and how to modify it, visit the link I have provided.

How to view files added through Google service account?

I need to create .NET console app to upload/download files to a user's Google drive.
I tried it using service account authorization. But I am not able to view the uploaded files using web UI. I am able view the list of files uploaded using my console APP. But I would like to know whether User Google Drive and files uploaded using my APP are located in different location.

How to upload files to shared folder in google drive as shared folder owner's quota?

I have to move a set of backup files of a web application day by day to google drive. For this my friend created a folder in the google drive and shared with me with edit permission so he can also the see the backup files.
So I created a application(with python) using the google drive api and started to upload files to google drive. After some 7+ uploads(7*2gb size for each file =14gb) the api started to raise an error shown below
An error occured: https://www.googleapis.com/upload/drive/v2/files?uploadType=resumable&alt=json returned "The user has exceeded their Drive storage quota">
Then I checked my storage and it shows "14gb used out 15gb".
Why this is happening? Actually I uploaded the files to the shared folder created by my friend and now it shows those are uploaded in my quota. Also tried with the drag and drop option, but it is also uploaded in my quota
I have the following questions
1) How can I upload the files to the shared folder in my friend's quota?
2) Is it possible to upload only 15gb data through my account? or How can I increase my quota?