Senparc.Xncf.FileManager
0.6.0-preview1
Prefix Reserved
dotnet add package Senparc.Xncf.FileManager --version 0.6.0-preview1
NuGet\Install-Package Senparc.Xncf.FileManager -Version 0.6.0-preview1
<PackageReference Include="Senparc.Xncf.FileManager" Version="0.6.0-preview1" />
<PackageVersion Include="Senparc.Xncf.FileManager" Version="0.6.0-preview1" />
<PackageReference Include="Senparc.Xncf.FileManager" />
paket add Senparc.Xncf.FileManager --version 0.6.0-preview1
#r "nuget: Senparc.Xncf.FileManager, 0.6.0-preview1"
#:package Senparc.Xncf.FileManager@0.6.0-preview1
#addin nuget:?package=Senparc.Xncf.FileManager&version=0.6.0-preview1&prerelease
#tool nuget:?package=Senparc.Xncf.FileManager&version=0.6.0-preview1&prerelease
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
KnowledgeBaseandSiteAssetrecords 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/MMorApp_Data/NcfFiles/site-assets/yyyy/MMwith generated storage names and validated relative-path metadata. Legacyyyyy/MMknowledge-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
SiteAssetis available anonymously at/assets/{id}/{fingerprint}; the endpoint resolves metadata rather than accepting a file-system path, sendsnosniff, 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
GetExtractedTextAsynconly forKnowledgeBasesources. - 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
AdminOnlypolicy.
Installation
<PackageReference Include="Senparc.Xncf.FileManager" Version="0.4.0-preview4" />
Key API
Registeractivates the module.NcfFolderServicecreates, validates, queries, updates, and safely deletes folder records.NcfFileServicemanages bounded physical storage, resource-purpose/visibility transitions, content metadata, and public asset URLs.FileAssetControllerserves explicitly published site assets through/assets/{id}/{fingerprint}.NcfFileTextExtractorprovides 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.FileTemplateAppServiceandFileTemplate_GetListResponseexpose template listing.CreateFolderRequest,FileUploadModel, andDeleteFileRequestmodel 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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.FileProviders.Embedded (>= 10.0.2)
- Senparc.CO2NET.WebApi (>= 2.1.9-preview)
- Senparc.Ncf.AreaBase (>= 0.23.3-preview7)
- Senparc.Ncf.DatabasePlant (>= 0.21.7-preview7)
- Senparc.Ncf.Service (>= 0.23.7-preview7)
- Senparc.Xncf.AreasBase (>= 0.13.5-preview7)
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 | 33 | 8/12/2026 |
| 0.5.1-preview6 | 61 | 8/8/2026 |
| 0.5.0-preview5 | 74 | 8/3/2026 |
| 0.4.0-preview4 | 57 | 7/31/2026 |
| 0.3.1-preview3 | 65 | 7/28/2026 |
| 0.3.0-preview2 | 60 | 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、同步当前窗口中的资源边界模型、服务与管理页兼容性调整