RsCode.Storage.LocalStorage 1.3.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package RsCode.Storage.LocalStorage --version 1.3.2                
NuGet\Install-Package RsCode.Storage.LocalStorage -Version 1.3.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="RsCode.Storage.LocalStorage" Version="1.3.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RsCode.Storage.LocalStorage --version 1.3.2                
#r "nuget: RsCode.Storage.LocalStorage, 1.3.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 RsCode.Storage.LocalStorage as a Cake Addin
#addin nuget:?package=RsCode.Storage.LocalStorage&version=1.3.2

// Install RsCode.Storage.LocalStorage as a Cake Tool
#tool nuget:?package=RsCode.Storage.LocalStorage&version=1.3.2                

开始使用 1.引用 RsCode.Storage.LocalStorage 2.配置 services.AddLocalStorage(Configuration);

appsettings.json中设置 //本地存储配置 "LocalStorage": { "UploadTokenUrl":"自定义的token获取地址", //例 /storage/uptoken "UploadUrl": "https://localhost:5001/storage/upload", "AccessKey": "",//不填 "SecretKey": "",//不填 "Domain": "上传后资源地址", //上传后资源地址,例:http://res.rscode.cn "Bucket": "", //不填 "Zone": "", //不填 "UploadTokenExpireTime": 30, // 上传token有效时间单位:秒 "DownloadTokenExpireTime": 5,//下载token有效时间 "ManageTokenExpireTime": 5 //管理token有效时间 }

3.自定义获取uptoken的逻辑 例: public class StorageController : Controller { public IActionResult UpToken([FromServices]IEnumerable<IStorageProvider> providers,string provider="local") { var qiniu = providers.FirstOrDefault(s ⇒ s.StorageName == provider); var tokenInfo= qiniu.GetUploadToken(); return Json(tokenInfo); } //本地上传逻辑 [HttpPost] public async Task<IActionResult> Upload([FromServices] IEnumerable<IStorageProvider> providers) { var local = providers.FirstOrDefault(s ⇒ s.StorageName == "local"); var tokenInfo= await local.UploadAsync(); return Json(tokenInfo); } }

上传token返回值: {domain:'合法域名',token:'上传token',upload_url:'上传地址'}

上传成功后的返回值 {res:'',key:'上传后的key'}

注意:使用本地上传时,在wwwroot文件夹中,确保保存文件的文件夹是存在的

Product 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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.6.1 215 12/17/2023
1.6.0 362 11/8/2022
1.3.8 545 10/27/2021
1.3.7 405 10/18/2021
1.3.6 428 1/21/2021
1.3.4 416 1/8/2021
1.3.3 414 1/7/2021
1.3.2 513 6/2/2020
1.3.1 550 5/31/2020

本地服务器存储服务