Allowing a third party website to save to my drive (and with no sharing permission) - google-drive-api

We're working on an app to sell our music and was wondering if Google Drive can be used as an online storage solution.
The user would complete the transaction on our site, and then authorize us to save the file (or multiple files) to their Google Drive.
The appeal to us is to solve downloading problems via the browser. I believe the Google Drive api returns a successful response when the delivery is complete. If incomplete, we would then either resend or update.
One other requirement is whether we can set permissions to not allow sharing after save (and for that setting to be permanent).

You can do everything you want. The last part about not allowing users to reshare, you can do this if you still own the file, but cannot do it if you have made the user own the file. I am not sure you could ever achieve that - a user can always download a file and share it themselves, whether you are using Drive or your own custom system.

Related

Google Drive marks all files as Abusive after uploading

I use Google Drive API for my website (people upload their content). Now all uploading files get abused mark automatically even if the file is empty .txt blank.
Also all old files have been marked as abusive and I can't send an review because there are too many of them.
I've made a video that provides easy understanding of the problem:
https://youtu.be/xLv8zUN2t8E
Answer:
This is not something Stack Overflow can help you with. You need to contact G Suite support and talk with them directly.
Further Information:
Using Google Drive to allow untrusted users to upload content, honestly, is a really bad idea. There are multiple reasons for this - the content of uploaded files isn't being vetted which can result in unwanted files in your Drive, while your G Suite quota can be used up rapidly by spam which renders your personal and site-wide upload abilities useless. You should use a dedicated file storage for this.
Contact G Suite support about this using the link relevant to you on this page. You can speak with a support agent and get this resolved in a private case without the need of posting any information publicly. Alternatively, you can request a review of a violation of the terms of service here.
Request a Review Violation:
You can request a review for a violation when you go to try and share the folder. As per Google's Help Pages:
When you try to share a file that's been flagged for a violation, you’ll see an option to have the file reviewed. To request a review of the file:
Open the file.
Click Share.
Click Request a review.
References:
Contact G Suite support
Abuse program policies and enforcement
Google Terms of Service
Request a review of a violation
To somehow download/access the file :
Install rclone
Then use the command : rclone --drive-acknowledge-abuse to download the file

How to pass Oauth2 authorization, Google Drive API

I'm trying to implement a shared filespace on an existing server that has its own login/authentication system. I'd prefer if I could use Google Drive or One Drive as the actual backing file store since then the files could (ideally) be edited in browser and automatically update for everyone else that has access to the shared area.
Diagrammatically (red link = existing authorization, red dashed line = desired auth in a session):
The need for this weird scheme stems from usage by a group where almost the entire set of members gets replaced each year (university committee). It was decided we don't just want to use a Google Drive folder since these end up in people's personal Google Drive folders, files get lost of cleared out etc. Additionally we already pass through this website quite regularly so it makes sense as an official repository of committee documents.
However this leaves me stuck with the issue in the diagram. I don't think that the server can create new, temporary tokens for a logged in user for them to pass to the Google Drive API to edit files. The question is really, can I get the Google API to do this for me somehow by only talking to the server? If not, what's the best way to implement this?
Thanks!

Google Drive API Share event

I have an application that provides protection through encryption to files.
One of my clients requested that I shall add an ability to his Google Drive to protect documents once they are downloaded from his account.
The scenario is as following:
- My client uploads files (documents, excel sheets etc.) into his google drive account.
- My client send share invites to his peers.
- My client peers can view the files online, and they can download the files.
- When my client peers try to downloade the files, I need to capture a download event, protect the file and then continue with the download process.
I searched everywhere but cannot find an answer that is even close to what I need to acheive.
Your'e help is much appreciated.
Unless they are downloading the files through your application, you cannot intercept requests like this.
Your only option is to have them protected in Drive before they are shared/downloaded.

How can we add a file to a user's files.list via the sdk?

We are having issues where sometimes a file that a user can access is not returned when the user issues a files.list. This can happen in many ways. For example, new members of a Google group will not see previously shared files, as described in this question. Moreover, acording to Google documentation there are other limits on sharing which can prevent shared files from appearing in the "Shared with me" view. Finally, a user can issue a files.delete on a file she doesn't own, and the file will disappear from files.list but will still exist.
What can a user do via the SDK alone to cause a file which she can access via files.get to appear in the list of files retrieved via files.list? We are using a service account which impersonates users; the user never authenticates to Google via a browser. A link in an email that the user needs to click won't work for us, unfortunately. Accessing the file via the Google Drive UI has the desired effect, but the analogous files.get call does not.
The Google Calendar API explicitly exposes a CalendarList interface where a user can issue an insert to add an existing calendar to her list. The Google Drive SDK seems like a hybrid Files/FilesList interface with some of the functionality missing (nothing like FilesList.insert) and some of the functionality mixed together (issuing a delete as a non-owner acts like FilesList.delete but issuing it as the owner acts like Files.delete).
If we can't manage the user's files list programmatically then it is not useful for our service. We could ignore the files.list call entirely and just start recursively performing children.list queries on all shared folders, but this is incredibly expensive (unless someone knows how to issue a single query which returns all the Files resources in a folder and not just the IDs of those resources).
Any help would be appreciated. We've been trying this many different ways and have been frustrated at every turn. Thanks!

Google Realtime API - share settings on shortcut file

This is a follow up to Google Realtime API - what is the role of a shortcut file in google drive?
What is the effect of share settings on a shortcut file? Does a user need to share this shortcut file with other collaborators?
In my case, my web application already contains share settings between users. These are my own share setting that I store in my database. They are currently sharing between each other but have to edit a file one person at a time. Ideally I would like to just use the settings from my application to seamlessly make it so that they can collaborate at the same time, without having them to once again give edit permissions.
The share settings control who has access to read or write to a realtime document, just like for any other Drive file.
They can be set programmatically via the Drive API, or you can allow users to update settings via a common sharing dialog. See https://developers.google.com/drive/manage-sharing
If you have an existing setup, you could programmatically transfer the share settings to the realtime shortcut files as one-off transition step. We don't generally recommend trying to keep them in sync, as it can be a bit tricky, but its possible.