0

I want to use the user's google drive as a database to store the app-specific data in his drive. To use it as a backup drive.

Now there is this documentation which is suppose to help how to implement it as the google says we can achieve this using google drive apis.

But there is not a single article that can help me to integrate it completely from a to z.

Some post i found but they are not again specific to the this use case i.e. "Store application-specific data". Also they are outdated

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Tehleel Mir
  • 743
  • 8
  • 27

1 Answers1

0

Im not exactly sure I understand what your issue is, so let me try to explain the documentation page for Store application-specific data that appears to be unclear to you.

Uploading to the app data folder is done exactly the same as uploading to any other folder. With three differences.

First off when you authorize your user you will need to use the scope of DriveScopes.DRIVE_APPDATA, This scope gives you access See, create, and delete its own configuration data in your Google Drive. Which will mean that you can only edit data that your application created.

Second. When you upload the file. The file type must be .json. Configuration files are .json thats it.

Finally when you upload the file you set the parent directory to appDataFolder.

 var fileMetadata = new Google.Apis.Drive.v3.Data.File()
            {
                Name = "config.json",
                Parents = new List<string>()
                {
                    "appDataFolder"
                }
            };

That's it, that is the only difference with google drive api and uploading to appDataFolder. Any google drive api upload example can be used.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449