ColinChang.OssHelper
1.2.2
See the version list below for details.
dotnet add package ColinChang.OssHelper --version 1.2.2
NuGet\Install-Package ColinChang.OssHelper -Version 1.2.2
<PackageReference Include="ColinChang.OssHelper" Version="1.2.2" />
paket add ColinChang.OssHelper --version 1.2.2
#r "nuget: ColinChang.OssHelper, 1.2.2"
// Install ColinChang.OssHelper as a Cake Addin #addin nuget:?package=ColinChang.OssHelper&version=1.2.2 // Install ColinChang.OssHelper as a Cake Tool #tool nuget:?package=ColinChang.OssHelper&version=1.2.2
OssHelper
Oss Helper for .Net Core, which provides STS, Policy Authentication, and common callback functions.
Functions
/// <summary>
/// 阿里云OSS STS授权
/// </summary>
/// <returns></returns>
Task<AssumeRoleResponse.AssumeRole_Credentials> GetStsAsync();
/// <summary>
/// 阿里云OSS Policy授权
/// </summary>
/// <returns></returns>
Task<dynamic> GetPolicyAsync(int category);
/// <summary>
/// OSS 通用回调
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<OssObject> CallbackAsync(HttpRequest request);
/// <summary>
/// 流式下载(如果要下载的文件太大,或者一次性下载耗时太长,您可以通过流式下载,一次处理部分内容,直到完成文件的下载)
/// </summary>
/// <param name="objectName"></param>
/// <param name="filename">本地文件存储</param>
/// <returns></returns>
Task DownloadAsync(string objectName, string filename);
/// <summary>
/// 流式下载(如果要下载的文件太大,或者一次性下载耗时太长,您可以通过流式下载,一次处理部分内容,直到完成文件的下载)
/// </summary>
/// <param name="objectName"></param>
/// <returns></returns>
Task<Stream> DownloadAsync(string objectName);
/// <summary>
/// 删除对象
/// </summary>
/// <param name="objectName"></param>
/// <returns></returns>
Task<DeleteObjectResult> DeleteObjectAsync(string objectName);
/// <summary>
/// 删除对象
/// </summary>
/// <param name="objectNames"></param>
/// <returns></returns>
Task<DeleteObjectsResult> DeleteObjectsAsync(IList<string> objectNames);
Sample
we just verify the mime type and size of the uploaded object in the Callback function. about how to use this, please check the Sample project.
be sure you've set your Access information in appsettings.json before running the sample.
Reference
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Aliyun.OSS.SDK.NetCore (>= 2.13.0)
- aliyun-net-sdk-sts (>= 3.0.4)
- BouncyCastle.Crypto.dll (>= 1.8.1)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Http (>= 5.0.0)
- Microsoft.Extensions.Options (>= 5.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 5.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 5.0.0)
- Newtonsoft.Json (>= 12.0.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ColinChang.OssHelper:
Package | Downloads |
---|---|
ColinChang.OssHelper.MultiBucket
an extension for OssHelper to support multiple clients in applications. |
|
ColinChang.OssDownloader
this is a downloader for aliyun oss resources. |
GitHub repositories
This package is not used by any popular GitHub repositories.
remove ObjectType enum.