Jc.S3
1.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Jc.S3 --version 1.0.2
NuGet\Install-Package Jc.S3 -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jc.S3" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jc.S3 --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jc.S3, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Jc.S3 as a Cake Addin #addin nuget:?package=Jc.S3&version=1.0.2 // Install Jc.S3 as a Cake Tool #tool nuget:?package=Jc.S3&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Jc.S3
aws s3 存储桶 基础访问模块
使用说明
/// <summary>
/// 实例化
/// </summary>
/// <param name="awsAccessKeyId"></param>
/// <param name="awsSecretAccessKey"></param>
/// <param name="bucketName">存储桶名称</param>
/// <param name="region">节点名称 参照[节点名称] </param>
/// <param name="serverUrl">服务器域名,默认:"http://s3.amazonaws.com"</param>
public JcS3(
string awsAccessKeyId,
string awsSecretAccessKey,
string bucketName,
string region,
string serverUrl = "http://s3.amazonaws.com")
/// <summary>
/// 检查存储桶是否存在
/// </summary>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public bool BucketIsExist()
/// <summary>
/// 创建存储桶
/// </summary>
/// <returns></returns>
public bool CreateBucket()
/// <summary>
/// 获取存储桶位置
/// </summary>
/// <returns></returns>
public string BucketLocation()
/// <summary>
/// 获取文件列表
/// </summary>
public List<S3Object> ListObject()
/// <summary>
/// 上传文件:成功 返回key
/// </summary>
/// <param name="key"></param>
/// <param name="filePath"></param>
/// <returns></returns>
public async Task<string> PutObject(string key, string filePath)
/// <summary>
/// 下载文件到本地
/// </summary>
/// <param name="key"></param>
/// <param name="filePath">本地绝对路径</param>
/// <returns></returns>
public async Task<string> GetObject(string key, string filePath)
/// <summary>
/// 获取下载地址
/// </summary>
/// <param name="key">key</param>
/// <param name="dayOut">超时天数</param>
/// <returns></returns>
public string GetObjectUrl(string key, int dayOut)
节点名称
/// <summary>
/// The US East (Virginia) regional endpoint.
/// S3-specific, use for backward compatibility only.
/// </summary>
private static readonly RegionEndpoint USEast1Regional = RegionEndpoint.GetEndpoint("us-east-1-regional", "US East (Virginia) regional");
/// <summary>The Africa (Cape Town) endpoint.</summary>
public static readonly RegionEndpoint AFSouth1 = RegionEndpoint.GetEndpoint("af-south-1", "Africa (Cape Town)");
/// <summary>The Asia Pacific (Hong Kong) endpoint.</summary>
public static readonly RegionEndpoint APEast1 = RegionEndpoint.GetEndpoint("ap-east-1", "Asia Pacific (Hong Kong)");
/// <summary>The Asia Pacific (Tokyo) endpoint.</summary>
public static readonly RegionEndpoint APNortheast1 = RegionEndpoint.GetEndpoint("ap-northeast-1", "Asia Pacific (Tokyo)");
/// <summary>The Asia Pacific (Seoul) endpoint.</summary>
public static readonly RegionEndpoint APNortheast2 = RegionEndpoint.GetEndpoint("ap-northeast-2", "Asia Pacific (Seoul)");
/// <summary>The Asia Pacific (Osaka) endpoint.</summary>
public static readonly RegionEndpoint APNortheast3 = RegionEndpoint.GetEndpoint("ap-northeast-3", "Asia Pacific (Osaka)");
/// <summary>The Asia Pacific (Mumbai) endpoint.</summary>
public static readonly RegionEndpoint APSouth1 = RegionEndpoint.GetEndpoint("ap-south-1", "Asia Pacific (Mumbai)");
/// <summary>The Asia Pacific (Singapore) endpoint.</summary>
public static readonly RegionEndpoint APSoutheast1 = RegionEndpoint.GetEndpoint("ap-southeast-1", "Asia Pacific (Singapore)");
/// <summary>The Asia Pacific (Sydney) endpoint.</summary>
public static readonly RegionEndpoint APSoutheast2 = RegionEndpoint.GetEndpoint("ap-southeast-2", "Asia Pacific (Sydney)");
/// <summary>The Asia Pacific (Jakarta) endpoint.</summary>
public static readonly RegionEndpoint APSoutheast3 = RegionEndpoint.GetEndpoint("ap-southeast-3", "Asia Pacific (Jakarta)");
/// <summary>The Canada (Central) endpoint.</summary>
public static readonly RegionEndpoint CACentral1 = RegionEndpoint.GetEndpoint("ca-central-1", "Canada (Central)");
/// <summary>The Europe (Frankfurt) endpoint.</summary>
public static readonly RegionEndpoint EUCentral1 = RegionEndpoint.GetEndpoint("eu-central-1", "Europe (Frankfurt)");
/// <summary>The Europe (Stockholm) endpoint.</summary>
public static readonly RegionEndpoint EUNorth1 = RegionEndpoint.GetEndpoint("eu-north-1", "Europe (Stockholm)");
/// <summary>The Europe (Milan) endpoint.</summary>
public static readonly RegionEndpoint EUSouth1 = RegionEndpoint.GetEndpoint("eu-south-1", "Europe (Milan)");
/// <summary>The Europe (Ireland) endpoint.</summary>
public static readonly RegionEndpoint EUWest1 = RegionEndpoint.GetEndpoint("eu-west-1", "Europe (Ireland)");
/// <summary>The Europe (London) endpoint.</summary>
public static readonly RegionEndpoint EUWest2 = RegionEndpoint.GetEndpoint("eu-west-2", "Europe (London)");
/// <summary>The Europe (Paris) endpoint.</summary>
public static readonly RegionEndpoint EUWest3 = RegionEndpoint.GetEndpoint("eu-west-3", "Europe (Paris)");
/// <summary>The Middle East (Bahrain) endpoint.</summary>
public static readonly RegionEndpoint MESouth1 = RegionEndpoint.GetEndpoint("me-south-1", "Middle East (Bahrain)");
/// <summary>The South America (Sao Paulo) endpoint.</summary>
public static readonly RegionEndpoint SAEast1 = RegionEndpoint.GetEndpoint("sa-east-1", "South America (Sao Paulo)");
/// <summary>The US East (N. Virginia) endpoint.</summary>
public static readonly RegionEndpoint USEast1 = RegionEndpoint.GetEndpoint("us-east-1", "US East (N. Virginia)");
/// <summary>The US East (Ohio) endpoint.</summary>
public static readonly RegionEndpoint USEast2 = RegionEndpoint.GetEndpoint("us-east-2", "US East (Ohio)");
/// <summary>The US West (N. California) endpoint.</summary>
public static readonly RegionEndpoint USWest1 = RegionEndpoint.GetEndpoint("us-west-1", "US West (N. California)");
/// <summary>The US West (Oregon) endpoint.</summary>
public static readonly RegionEndpoint USWest2 = RegionEndpoint.GetEndpoint("us-west-2", "US West (Oregon)");
/// <summary>The China (Beijing) endpoint.</summary>
public static readonly RegionEndpoint CNNorth1 = RegionEndpoint.GetEndpoint("cn-north-1", "China (Beijing)");
/// <summary>The China (Ningxia) endpoint.</summary>
public static readonly RegionEndpoint CNNorthWest1 = RegionEndpoint.GetEndpoint("cn-northwest-1", "China (Ningxia)");
/// <summary>The AWS GovCloud (US-East) endpoint.</summary>
public static readonly RegionEndpoint USGovCloudEast1 = RegionEndpoint.GetEndpoint("us-gov-east-1", "AWS GovCloud (US-East)");
/// <summary>The AWS GovCloud (US-West) endpoint.</summary>
public static readonly RegionEndpoint USGovCloudWest1 = RegionEndpoint.GetEndpoint("us-gov-west-1", "AWS GovCloud (US-West)");
/// <summary>The US ISO East endpoint.</summary>
public static readonly RegionEndpoint USIsoEast1 = RegionEndpoint.GetEndpoint("us-iso-east-1", "US ISO East");
/// <summary>The US ISO WEST endpoint.</summary>
public static readonly RegionEndpoint USIsoWest1 = RegionEndpoint.GetEndpoint("us-iso-west-1", "US ISO WEST");
/// <summary>The US ISOB East (Ohio) endpoint.</summary>
public static readonly RegionEndpoint USIsobEast1 = RegionEndpoint.GetEndpoint("us-isob-east-1", "US ISOB East (Ohio)");
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- AWSSDK.S3 (>= 3.7.8.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.