Web app can create a Google Drive Folder, how can it list files inside that it didn't create? - permissions

I'm trying to be a good citizen and use the drive.file scope, but I'm hitting some snags and not entirely sure how to work through them.
Overview:
user logs into my application, which uses drive.file scope
my application creates a new Folder in the user's Drive, then creates a File in that folder
the user adds new files to that Folder on their own through the Drive interface
my application searches that Folder and only finds the files it created
How do I allow my web app to read ALL of the files inside of a folder it has created, not just the files it has also created?
I had assumed the answer was in the Permissions API, that perhaps I would create a new Permission, but the docs don't seem to make sense for an API client. Would it be a "user" type permission? If so, I must provide an email address parameter, but what email address should be used for the client? Would it be a "domain" type permission? What domain would I use? Am I just searching for files wrong, and some option would expose the other files to my app?
Thanks in advance!

The documentation specifies that drive.file gives only Per-file access to files created or opened by the app
If you see the descriptions of all other possible scopes, you will relaize that unfortunately there is no such scope that gives you access to all files in a certain folder, but not to any other folder on user's drive.
Thus, the scopes will not help you here.
If you want to have access only to files in a certain folder, you need to implement a workaround.
E.g., you can deploy the WebApp as "You" and ask the user to share the folder of interest with you. Then, the WebApp will only have access to the respective folder.

Related

Full access Google Drive API

For Google Drive API, the drive.file scope seems to give only access to the files created by the app. Is there a scope for Google Drive that gives access to the entire drive? Thanks
You may refer with this documentation. Full access to all files in the user's Drive (https://www.googleapis.com/auth/drive) may be necessary for some apps. An app designed to sync files, for instance, needs this level of access to Drive. Apps with special needs related to listing or reorganizing files might need full scope.
Check the sample code in this GitHub page.
Try this scope :
Google Drive
This will bring Full permissive scope to access all of a user's files

Store data into google drive's backup tab instead of drive folders

I need to implement same thing like whatsapp storing all chat history to google drive on clicking on backup button in app. And same restore it in new device as required.
I have look for below references for implementing this, but some how I was not able to do it successfully.
https://developer.android.com/guide/topics/data/backup.html
https://developer.android.com/guide/topics/data/data-storage.html
https://developer.android.com/guide/topics/data/data-storage.html#db
Will this data backup option will help in my requirements or I need to do something else?
I successfully developed the file upload to google drive folders, but i need that data in the backup tab of google drive with app name.
can any one guide me how I can implement this or provide me some references?
Thanks in advance..!
You may refer with this documentation. The Google Drive API includes a special hidden folder that your app can use to store application data.
Note: This feature now uses the alias appDataFolder in place of appdata and appfolder.
To be able to use your Application Data folder, request access to the following scope:
https://www.googleapis.com/auth/drive.appdata
For more information about scopes and how to request access to them, see Authorizing Your App with Google Drive.

OneDrive API Link Sharing Options

I'm currently working on an application that interacts with OneDrive. I've read RESTful API manual and the only option available is to share document.
My questions are:
Is there any way to remove or regenerate file sharing link?
Is there any way to specify user emails to give an access to them?
Is there any way to control this UI option "Recipients need to sign in with Microsoft Account"?
The sharing links that are created do not expire. If you create a sharing link for a file that already shared, a HTTP 200 code will be returned. At this time, createLink is only available but the user can remove the sharing permission from the OneDrive website. Specific user access isn't currently supported. Like the OneDrive website, any created link will not require sign-in. I hope that helps.
The only way to regenerate link to a file is to:
Copy file "foo.docx" to "(Copy) foo.docx"
Remove file "foo.docx"
Rename "(Copy) foo.docx" to "foo.docx"
Generate link for "foo.docx"
There is no way to specify emails for document access
There is no way to control this UI option "Recipients need to sign in with Microsoft Account"

Web Server for Upload files

I have a requirement where I want HTML FTP to be accessed by AD users. When users prompted to supply their AD credentials, the IIS/FTP should mapped them directly to their folders. What I want is, an HTML "Form" page/website when its accessed from internal/external it will prompt and users will supply AD credentials. Based on the permission set on the folders users will access only their folder and will upload to their folder only. The Upload as a Browse Button which will allow them to upload specified documents to their folder only. So, When they log into their computer at work they will be able to see what has been uploaded and will be able to open that document directly.
This is actually for Part Time Lectures, currently all the shared we have on a Windows 2008 R2 and permission set based on AD.
Is this doable via HTML or any other code or FTP itself. Even third party software which will be fine too.
It might be worth taking a look at plupload - depending on your usage, you might need to pay licensing: http://www.plupload.com

Downloading files from shared dropbox location in c#

In my application users will give a url to their shared dropbox folder. When it is given I want to grab the images in that url and download to a folder in my application.
Is this achievable?
I've tried to do this in SharpBox. I've managed to open a connection to dropbox storage through SharpBox and successfully connect to my public folders.
But I couldn't find a method which accepts a shared dropbox url and download files from that url.
Thanks
This article might be helpful, don't know enough about the edge cases in your particular use though.
https://www.dropbox.com/help/201/en