Sh.Common.WebHelper
1.0.0
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 Sh.Common.WebHelper --version 1.0.0
NuGet\Install-Package Sh.Common.WebHelper -Version 1.0.0
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="Sh.Common.WebHelper" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sh.Common.WebHelper --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sh.Common.WebHelper, 1.0.0"
#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 Sh.Common.WebHelper as a Cake Addin #addin nuget:?package=Sh.Common.WebHelper&version=1.0.0 // Install Sh.Common.WebHelper as a Cake Tool #tool nuget:?package=Sh.Common.WebHelper&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
.net Core 3.1 Web 程序
<br>
权限等 再子类中进行限制
自定义文件上传
可用 Controller 方式 :FileManagerController 继承 他便可以了
,如果需要 限制上传 再实现类中限制
/// <summary>
/// 上传文件大小限制
/// </summary>
public virtual long FileSizeLimit { get; set; } = 2 * 1024 * 1024;
/// <summary>
/// 支持的扩展名
/// </summary>
public virtual string[] PermittedExtensions { get; set; } = { ".txt" };
/// <summary>
/// 存储位置
/// </summary>
///
private string _targetFilePath = "Upload";
Streaming上传文件信息:UploadStreamingPhysical
单个上传文件:UploadFile
多文件上传: UploadFiles
获取 上传目录中的文件信息 :GetPhysicalFilesName
public class NodeModel { public string Name { get; set; } public NodeTypeEnum Type { get; set; } public string FileExt { get; set; } public string Path { get; set; } public long Size { get; set; } public DateTime Cdate { get; set; } public List<NodeModel> NextNodeModel { get; set; } } public enum NodeTypeEnum { 文件夹, 文件 }
删除目录或者文件夹:DeletePhysical
PageModel 方式 继承:FileManagerPageModelModel
页面限制与上面一样 不同 是 页面资源 的绑定
[BindProperty]
public FileUploadPhysical FileUpload { get; set; }
类结构
public class FileUploadPhysical
{
[Required]
[Display(Name = "文件")]
public IFormFile FormFile { get; set; }
}
上传支持 OnPostUploadAsync()
KinderEditer 的文件上传 处理 KindEditorFileManagerController
因为之前 用了国内开源的 Edetor 只有他的图有上传功能。所以 就用了他
此类 继承后可以直接使用 可修改的限定 都事 Pretected 的字段 再子类中 修改
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.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Microsoft.AspNetCore.Http.Connections.Common (>= 3.1.3)
- Microsoft.AspNetCore.Http.Features (>= 3.1.3)
- Microsoft.AspNetCore.Owin (>= 3.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.