Cloud Storage Account Management
- 2 minutes to read
This topic describes how to connect the ASPxUploadControl, ASPxFileManager and ASPxHtmlEditor controls to popular cloud storage services such as Amazon, Azure, Dropbox, Google Drive, and OneDrive.
Follow the steps below to configure the functionality that allows end users to work with files stored on a cloud storage service.
Use the following methods of the AccountManager class to register a cloud storage account within the Global.asax_ file in the
Application_Start
event handler.- AccountManager.Register
- AccountManager.RegisterAzure
- AccountManager.RegisterAmazon
- AccountManager.RegisterDropbox
- AccountManager.RegisterGoogleDrive
- AccountManager.RegisterOneDrive
The example below registers cloud storage accounts in the Global.asax file.
void Application_Start(object sender, EventArgs e) { DevExpress.Web.AccountManager.RegisterAzure("Azure1", "StorageName1", "AccessKey1"); DevExpress.Web.AccountManager.RegisterAmazon("Amazon1", "AccessKeyID1", "SecretAccessKey1"); DevExpress.Web.AccountManager.RegisterDropbox("Dropbox1", "AccessTokenValue1"); DevExpress.Web.AccountManager.RegisterGoogleDrive("FileManagerGoogleDriveAccount", "custom-service-account@api-project-82456107.iam.gserviceaccount.com", "..MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVoaYrE7fEgu..."); DevExpress.Web.AccountManager.RegisterGoogleDrivePersonal("FileManagerGoogleDrivePersonalAccount", "customClientID", "..MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVoaYrE7fEgu..."); DevExpress.Web.AccountManager.RegisterOneDrive("FileManagerOneDriveAccount", "f49c387c-1c25-4f27-855b-dfd3fd3", "..+SKN3n5H0/KZVb6c=..."); }
If you store the key in the
web.config
file, it is necessary to pass it as a single string without the \n character.<add key="UploadGoogleDriveClientEmailValue" value="custom-service-account@api-project-82456107.iam.gserviceaccount.com"/> <add key="UploadGoogleDrivePrivateKeyValue" value="..MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVoaYrE7fEgu..."/>
Use a control’s
AccountName
property to specify the storage account to be used by the control. The following table listsAccountName
properties for each control.<dx:ASPxUploadControl ID="UploadControl" runat="server" UploadStorage="Azure"> <AzureSettings AccountName="Azure1" ContainerName="uploadcontainer" /> </dx:ASPxUploadControl> <dx:ASPxFileManager ID="FileManager" runat="server" ProviderType="Amazon"> <SettingsAmazon AccountName="Amazon1" BucketName="filesbucket" Region="us-east-1" /> </dx:ASPxFileManager> <dx:ASPxHtmlEditor ID="HtmlEditor" runat="server"> <SettingsDialogs> <InsertImageDialog> <SettingsImageSelector Enabled="true" ProviderType="Dropbox"> <SettingsDropbox AccountName="Dropbox1" /> </SettingsImageSelector> <SettingsImageUpload UploadStorage="Dropbox"> <DropboxSettings AccountName="Dropbox1" /> </SettingsImageUpload> </InsertImageDialog> </SettingsDialogs> </dx:ASPxHtmlEditor>