Foundatio.Aliyun
Foundatio provides Alibaba Cloud OSS file storage implementation. View source on GitHub →
Overview
| Implementation | Interface | Package |
|---|---|---|
AliyunFileStorage | IFileStorage | Foundatio.Aliyun |
Installation
bash
dotnet add package Foundatio.AliyunUsage
csharp
using Foundatio.Storage;
var storage = new AliyunFileStorage(o =>
o.ConnectionString = connectionString);
await storage.SaveFileAsync("documents/report.pdf", pdfStream);
var stream = await storage.GetFileStreamAsync("documents/report.pdf");Configuration
Connection String (required):
csharp
var storage = new AliyunFileStorage(o =>
{
o.ConnectionString = "endpoint=oss-cn-hangzhou.aliyuncs.com;accessKeyId=xxx;accessKeySecret=yyy;bucket=my-bucket";
});For additional options including LoggerFactory, Serializer, TimeProvider, and ResiliencePolicyProvider, see the AliyunFileStorageOptions source.
Next Steps
- File Storage Guide - Usage patterns and best practices
- Serialization - Configure serialization