Skip to content

File Storage Options in GroupDocs.Editor RESTful for .NET

Viktor Stupak edited this page Apr 10, 2024 · 2 revisions

GroupDocs.Editor is a comprehensive document editing API that enables developers to integrate advanced document editing functionalities into their .NET applications. In this wiki article, we will explore how to specify file storage options for a GroupDocs.Editor RESTful service using ASP.NET Core Web API. By allowing users to choose between different storage providers such as AWS S3, local storage, and Azure Blob Storage, developers can tailor the solution to meet specific requirements.

Setting up the Environment

Firstly, ensure you have a .NET environment set up and ready to go. Install the necessary packages using NuGet, including GroupDocs.Editor.UI.Api, which is essential for integrating GroupDocs.Editor into your project.

Configuring File Storage Providers

Once the environment is set up, you can configure the file storage providers. In your ASP.NET Core Web API startup code, use the AddEditor method to specify the desired storage provider. For example:

builder.Services.AddEditor<AwsS3Storage>(builder.Configuration);
builder.Services.AddEditor<LocalStorage>(builder.Configuration);
builder.Services.AddEditor<AzureBlobStorage>(builder.Configuration);

This allows users to choose between AWS S3, local storage, or Azure Blob Storage as their preferred file storage option.

Configuration via appsettings.json

The configuration details for each storage provider can be specified in the appsettings.json file. For instance:

AWS S3 Storage:

"AWS": {
    "Profile": "s3-groupdoc-editor-demo",
    "Bucket": "groupdocs-app",
    "RootFolderName": "groupdocseditor",
    "LinkExpiresDays": 360,
    "Region": "us-west-2",
    "AccessKey": "AKIA",
    "SecretKey": "yn6dri"
}

Local Storage:

"LocalStorageOptions": {
    "RootFolder": "pathToStorage",
    "BaseUrl": "https://yourBaseUrl"
}

To enable users to utilize Local File storage, ensure that the LocalFile property in the FeatureManagement section of appsettings.json is set to true.

Ensure to replace placeholder values such as pathToStorage and https://yourBaseUrl with actual configuration details.

Azure Blob Storage:

"AzureBlobOptions": {
    "AccountName": "gdteage",
    "AccountKey": "6praFsb2c789g==",
    "ContainerName": "gdvieui",
    "LinkExpiresDays": 360
}

Configuring file storage options in GroupDocs.Editor RESTful for .NET provides flexibility and customization for users. By allowing users to choose between AWS S3, local storage, or Azure Blob Storage, developers can cater to various use cases and preferences. Utilizing the appsettings.json file for configuration makes the process straightforward and manageable. With these options in place, developers can seamlessly integrate document editing functionalities into their .NET applications using GroupDocs.Editor.

Clone this wiki locally