Back to Devexpress

Google Drive File System Provider

aspnet-120623-components-file-management-file-manager-concepts-file-system-providers-google-drive-file-system-provider.md

latest3.7 KB
Original Source

Google Drive File System Provider

  • Nov 24, 2023
  • 2 minutes to read

The Google Drive file system provider (GoogleDriveFileSystemProvider) allows you to connect ASPxFileManager to Google Drive.

Prerequisites

Register the Google Drive service account that is linked to your application. The service account allows you to use the Google APIs to access a user’s account without client-side authorization.

Configure Google Drive Service Account

Follow the steps below to configure your Google Drive service account.

  1. Open the Service accounts page and click Create.

  1. In the New Project window, enter the project name and click Create.

  1. Open the Google API Console page to obtain the service account’s credentials. Click Enable APIs and Services to access the Google Drive API.

  1. Click Google Drive API to enable it.

  1. In the Credentials section, click Create credentials and select Service account key from the drop-down menu.

  1. Click Create to create the service account key in JSON format and save the .json file to your computer.

  1. Open the downloaded JSON file and get the credentials from it.

Private key :

Client Email :

csharp
...
AccountManager.RegisterGoogleDrive("Google", "[email protected]", 
"DANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCu6OragV1n…...");

Provider Settings

Set the ASPxFileManager.ProviderType property to FileManagerProviderType.GoogleDrive to allow ASPxFileManager to manage files and folders in Google Drive.

The GoogleDriveFileSystemProvider class allows you to access the file and folder hierarchy, and manipulate these files in the file manager.

Do the following to connect ASPxFileManager to Google Drive:

ASPxFileManager allows you to handle every request to Google Drive (the ASPxFileManager.CloudProviderRequest event).