An open API service indexing awesome lists of open source software.

https://github.com/nemeslaszlo/cloud.file.storage.manager

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file append and delete.
https://github.com/nemeslaszlo/cloud.file.storage.manager

amazon-s3 azure azure-blob azure-blob-storage box box-storage dotnet fileoperations minio minio-storage physical-storage s3-storage

Last synced: 11 months ago
JSON representation

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file append and delete.

Awesome Lists containing this project

README

          

# Cloud File Storage Manager

## Azure Blob Storage

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file move and delete. Primarily for `Azure (Azure Blob Storage)` right now.

### Configuration

Let's add a section to the `appsettings.json`

```
"AzureStorageSettings": {
"Protocol": "https",
"AccountName": "",
"AccountKey": "",
"ContainerName": "",
// Optional - Leave empty to use azure default url, otherwise provide the hostname (without the protocol and path) of the endpoint
"Url": ""
}
```
In the application, configure this settings part

```cs
services.AddSingleton(services => new AzureCloudFileStorageManager(new AzureCloudFileStorageManagerOptions()
{
AccountName = config.GetSection("AzureStorageSettings").GetValue("AccountName"),
AccountKey = config.GetSection("AzureStorageSettings").GetValue("AccountKey"),
ContainerName = config.GetSection("AzureStorageSettings").GetValue("ContainerName"),
Protocol = config.GetSection("AzureStorageSettings").GetValue("Protocol"),
Url = config.GetSection("AzureStorageSettings").GetValue("Url")
}));

```

## Amazon S3

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file move and delete. Primarily for `Amazon S3` right now.

### Configuration

Let's add a section to the `appsettings.json`

```
"AmazonS3torageSettings": {
"IsAnonymus": false,
"AccessKey": "",
"SecretKey": "",
"BucketName": "",
"BucketRegion": ""
}
```
In the application, configure this settings part

```cs
services.AddSingleton(services => new AmazonS3FileStorageManager(new AmazonS3FileStorageManagerOptions()
{
IsAnonymus = config.GetSection("AmazonS3torageSettings").GetValue("IsAnonymus"),
AccessKey = config.GetSection("AmazonS3torageSettings").GetValue("AccessKey"),
SecretKey = config.GetSection("AmazonS3torageSettings").GetValue("SecretKey"),
BucketName = config.GetSection("AmazonS3torageSettings").GetValue("BucketName"),
BucketRegion = config.GetSection("AmazonS3torageSettings").GetValue("BucketRegion")
}));

```

## Minio (Amazon S3 Compatible Cloud Storage)

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file move and delete. Primarily for `Minio .NET SDK for Amazon S3 Compatible Cloud Storage.` right now.

### Configuration

Let's add a section to the `appsettings.json`

```
"MinioStorageSettings": {
"HostAndPort": "",
"UseSSL": false,
"AccessKey": "",
"SecretKey": "",
"BucketName": ""
}
```
In the application, configure this settings part

```cs
services.AddSingleton(services => new MinioCloudFileStorageManager(new MinioCloudFileStorageManagerOptions()
{
HostAndPort = config.GetSection("MinioStorageSettings").GetValue("HostAndPort"),
UseSSL = config.GetSection("MinioStorageSettings").GetValue("UseSSL"),
AccessKey = config.GetSection("MinioStorageSettings").GetValue("AccessKey"),
SecretKey = config.GetSection("MinioStorageSettings").GetValue("SecretKey"),
BucketName = config.GetSection("MinioStorageSettings").GetValue("BucketName")
}));

```

## Physical

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file move and delete. Primarily for `Physical` right now.

### Configuration

Let's add a section to the `appsettings.json`

```
"PhysicalStorageSettings": {
"RootDirectoryPath": "",
}
```
In the application, configure this settings part

```cs
services.AddSingleton(services => new PhysicalFileStorage(new PhysicalFileStorageOptions()
{
RootDirectoryPath = config.GetSection("PhysicalStorageSettings").GetValue("RootDirectoryPath")
}));

```

## Box

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file move and delete. Primarily for `Box` right now.

### Configuration

Let's add a section to the `appsettings.json`

```
"BoxStorageSettings": {
"ClientId": "",
"ClientSecret": "",
"EnterpriseId": "",
"PublicKeyId": "",
"PrivateKey": "",
"Passphrase": "",
"RootFolderId": "0"
}
```
In the application, configure this settings part

```cs
services.AddSingleton(services => new BoxFileStorageManager(new BoxFileStorageManagerOptions()
{
ClientId = config.GetSection("BoxStorageSettings").GetValue("ClientId"),
ClientSecret = config.GetSection("BoxStorageSettings").GetValue("ClientSecret"),
EnterpriseId = config.GetSection("BoxStorageSettings").GetValue("EnterpriseId"),
PublicKeyId = config.GetSection("BoxStorageSettings").GetValue("PublicKeyId"),
PrivateKey = config.GetSection("BoxStorageSettings").GetValue("PrivateKey"),
Passphrase = config.GetSection("BoxStorageSettings").GetValue("Passphrase"),
RootFolderId = config.GetSection("BoxStorageSettings").GetValue("RootFolderId")
}));

```

## SharePoint

Provides complete implementation to handle easily cloud file storage operations like get informations about files, reading, downloadURL generation, file update, file move and delete. Primarily for `SharePoint` right now.

### Configuration

Let's add a section to the `appsettings.json`

```
"SharePointStorageSettings": {
// The SharePoint site URL (e.g., https://tenant.sharepoint.com/sites/sitename)
"SiteUrl": "",
"DocumentLibraryName": "",
"TenantId": "",
"ClientId": "",
"ClientSecret": "",
// Optional: The folder name where the files will be stored, like: "MainFolder/WorkFolder/Test"
"WorkFolderPath": ""
}
```
In the application, configure this settings part

```cs
services.AddSingleton(services => new SharePointCloudFileStorageManager(new SharePointCloudFileStorageManagerOptions()
{
SiteUrl = config.GetSection("SharePointStorageSettings").GetValue("SiteUrl"),
DocumentLibraryName = config.GetSection("SharePointStorageSettings").GetValue("DocumentLibraryName"),
TenantId = config.GetSection("SharePointStorageSettings").GetValue("TenantId"),
ClientId = config.GetSection("SharePointStorageSettings").GetValue("ClientId"),
ClientSecret = config.GetSection("SharePointStorageSettings").GetValue("ClientSecret")
WorkFolderPath = config.GetSection("SharePointStorageSettings").GetValue("WorkFolderPath")
}));

```