Back to Devexpress

Cloud Storage Account Management

aspnetmvc-402284-common-features-cloud-storage-account-management.md

latest2.3 KB
Original Source

Cloud Storage Account Management

  • Nov 24, 2023
  • 2 minutes to read

This topic describes how to connect the UploadControl, FileManager and HtmlEditor components to popular cloud storage services such as Amazon , Azure , Dropbox , Google Drive and OneDrive. This functionality allows end users to work with files stored on a cloud storage service - as explained in the steps below.

  1. 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.

  2. Use a component’s AccountName property to specify the storage account to be used by a component. The following table lists AccountName properties for each component.

razor
@Html.DevExpress().UploadControl(settings => {
    settings.Name = "uploadControl";

    settings.UploadStorage = "Azure";
    settings.AzureSettings.AccountName = "Azure1";
    //...
}).GetHtml()

@Html.DevExpress().HtmlEditor(settings => {
    settings.Name = "htmlEditor";

    settings.SettingsDialogs.InsertImageDialog.SettingsImageSelector.Enabled = true;
    settings.SettingsDialogs.InsertImageDialog.SettingsImageSelector.ProviderType = FileManagerProviderType.Dropbox;
    settings.SettingsDialogs.InsertImageDialog.SettingsImageSelector.SettingsDropbox.AccountName = "Dropbox1";

    settings.SettingsDialogs.InsertImageDialog.SettingsImageUpload.UploadStorage = UploadFileStorageType.Dropbox;
    settings.SettingsDialogs.InsertImageDialog.SettingsImageUpload.DropboxSettings.AccountName = "Dropbox1";
    //...
}).GetHtml()

@Html.DevExpress().FileManager(settings => {
    settings.Name = "fileManager";
    //...
    }
).BindToFileSystemProvider(CloudProviderHelper.CreateAmazonProvider(Model)).GetHtml()
csharp
static AmazonFileSystemProvider CreateAmazonProvider() {
    var provider = new AmazonFileSystemProvider("/");
    provider.AccountName = "FileManagerAmazonAccount";
    provider.BucketName = "dxdemobucket";
    return provider;
}