Senparc.Xncf.FileManager 0.6.0-preview1

Prefix Reserved
This is a prerelease version of Senparc.Xncf.FileManager.
dotnet add package Senparc.Xncf.FileManager --version 0.6.0-preview1
                    
NuGet\Install-Package Senparc.Xncf.FileManager -Version 0.6.0-preview1
                    
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="Senparc.Xncf.FileManager" Version="0.6.0-preview1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Senparc.Xncf.FileManager" Version="0.6.0-preview1" />
                    
Directory.Packages.props
<PackageReference Include="Senparc.Xncf.FileManager" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Senparc.Xncf.FileManager --version 0.6.0-preview1
                    
#r "nuget: Senparc.Xncf.FileManager, 0.6.0-preview1"
                    
#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.
#:package Senparc.Xncf.FileManager@0.6.0-preview1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Senparc.Xncf.FileManager&version=0.6.0-preview1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Senparc.Xncf.FileManager&version=0.6.0-preview1&prerelease
                    
Install as a Cake Tool

Senparc.Xncf.FileManager

Senparc.Xncf.FileManager is an NCF module for bounded local file storage that serves two isolated purposes: safe source documents for KnowledgeBase and publishable static assets for the site.

Features

  • Separates KnowledgeBase and SiteAsset records and folders. A file cannot be changed from one purpose to the other in the management UI.
  • Stores new physical files below App_Data/NcfFiles/knowledge-base/yyyy/MM or App_Data/NcfFiles/site-assets/yyyy/MM with generated storage names and validated relative-path metadata. Legacy yyyy/MM knowledge-base paths remain readable.
  • Limits uploads to 50 MB per file, 20 files and 100 MB per request, with a purpose-specific extension allowlist.
  • Computes SHA-256 while writing each new file and persists its MIME type and content hash.
  • Keeps static assets private by default. Only a published SiteAsset is available anonymously at /assets/{id}/{fingerprint}; the endpoint resolves metadata rather than accepting a file-system path, sends nosniff, supports ranges, and uses immutable caching only for a matching fingerprint.
  • Cleans up the physical file when metadata persistence fails and stages deletion so a database failure can restore the file.
  • Prevents deletion of non-empty folders and rejects missing parents, duplicate sibling names, and path-like folder names.
  • Returns the original filename for downloads and exposes GetExtractedTextAsync only for KnowledgeBase sources.
  • Safely decodes UTF-8/UTF-16 text and parses DOCX, PPTX, and XLSX XML with DTDs disabled and decompressed-entry limits.
  • Protects file listing and deletion application-service APIs with the NCF AdminOnly policy.

Installation

<PackageReference Include="Senparc.Xncf.FileManager" Version="0.4.0-preview4" />

Key API

  • Register activates the module.
  • NcfFolderService creates, validates, queries, updates, and safely deletes folder records.
  • NcfFileService manages bounded physical storage, resource-purpose/visibility transitions, content metadata, and public asset URLs.
  • FileAssetController serves explicitly published site assets through /assets/{id}/{fingerprint}.
  • NcfFileTextExtractor provides dependency-free extraction for .txt, .log, .md, .markdown, .csv, .tsv, .json, .xml, .yaml, .yml, .html, .htm, .css, .js, .ts, .cs, .sql, .docx, .pptx, and .xlsx.
  • FileTemplateAppService and FileTemplate_GetListResponse expose template listing.
  • CreateFolderRequest, FileUploadModel, and DeleteFileRequest model common operations.

Current boundaries

  • KnowledgeBase uploads are intentionally limited to formats the module can extract safely: text, structured/code text, .docx, .xlsx, and .pptx. PDF, legacy Office, images, OCR, archives, and audio require a separately sandboxed parser.
  • Static-asset uploads accept images, audio/video, and fonts. HTML, SVG, JavaScript, and archives are deliberately excluded from the same-origin public-asset endpoint.
  • The module does not perform antivirus/content-disarm scanning or object-storage replication. Production hosts should scan uploads before exposing them to other users.
  • KnowledgeBase ingestion is snapshot-based; FileManager does not depend on or cascade-delete data in higher-level modules.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Senparc.Xncf.FileManager:

Package Downloads
Senparc.Xncf.KnowledgeBase

AI 知识库

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0-preview1 0 8/12/2026
0.5.1-preview6 58 8/8/2026
0.5.0-preview5 71 8/3/2026
0.4.0-preview4 56 7/31/2026
0.3.1-preview3 64 7/28/2026
0.3.0-preview2 59 7/26/2026
0.2.1-preview1 90 6/17/2026
0.1.12.1-preview 80 5/22/2026
0.1.2-preview 81 6/16/2026

v0.1.0 创世
     v0.1.3.4 修复文件上传问题
     [2025-06-20] v0.1.5-preview Add MCP functions in XncfRegisterBase class
     [2025-07-27] v0.1.6-preview.1 update Knowledge Base
     [2025-11-01] update basic libraries, including Senparc.AI
     [2026-01-07] v0.1.9-preview.1 Reset all database migrations
     [2026-04-24] Simplify FunctionRender request parameters and keep SelectionList UI metadata compatibility
     [2026-07-17] v0.3.0-preview2 为 FileManager 模块接入统一资源本地化并优化功能文案
     1、接入统一资源本地化机制,支持模块功能文案按当前文化动态显示
     2、更新 FunctionRender 与请求模型文案的资源化解析
     3、统一模块注册信息、菜单名称与功能描述的本地化输出
     4、同步管理页面与前端交互文案的多语言显示
     5、调整文件管理页链接导航处理,兼容桌面内嵌 WebView
     [2026-07-29] v0.3.1-preview3 加强文件上传校验和物理路径安全
     1、增加防伪校验、文件数量/大小/扩展名限制并规范原始文件名
     2、通过规范化路径阻止文件读取、删除和下载越界
     [2026-07-31] v0.4.0-preview4 扩展 FileManager 管理界面的多语言能力
     1、新增文件管理资源与前端本地化脚本
     2、升级 Senparc.CO2NET.WebApi 至 2.1.9-preview
     [2026-08-04] v0.5.0-preview5 新增文件文本提取与文件管理服务
     1、新增 NcfFileTextExtractor 以支持文件内容提取
     2、优化文件、目录及模板应用服务的处理流程
     [2026-08-08] v0.5.1-preview6 Dependency updates from upstream projects
     1、Dependency update from Senparc.Ncf.AreaBase to 0.23.2-preview6
     2、Dependency update from Senparc.Ncf.DatabasePlant to 0.21.6-preview6
     3、Dependency update from Senparc.Ncf.Service to 0.23.6-preview6
     4、Dependency update from Senparc.Xncf.AreasBase to 0.13.4-preview6
     [2026-08-13] v0.6.0-preview1 重构文件资源边界
     1、区分知识库源文件和站点静态资源,按用途隔离文件夹、列表与知识库摄取
     2、站点资源默认私有,显式发布后提供带 SHA-256 指纹的公开 URL 和长期缓存
     3、补齐 MIME、完整性指纹、流式下载、目录编辑删除与静态资源发布管理
     4、同步当前窗口中的资源边界模型、服务与管理页兼容性调整