File Management

Overview
The File Management module is used to manage file resources in the system, supporting file upload, group management, image preview, WebP format conversion, and compression. Uploaded images are automatically validated for validity, compressed in size, and converted to WebP format to save storage space. In multi-tenant mode, files are stored in directories segregated by tenant code for file isolation between tenants.
Usage
Accessing the File Management Page
Navigate to "System Management" → "File Management" in the system navigation bar.
Uploading Files
- Click the "Upload" button or drag files into the CardUpload area.
- Optionally select a file group (defaults to automatic archiving by date).
- The system automatically validates the file type (based on allowed/denied extensions configured in settings) and size (default 10MB).
- Upon successful upload, the file information is automatically added to the list.
Viewing and Managing Files
- List Display: The file list shows the file name, size, type, upload time, and other information.
- Image Preview: Hover or click to preview images.
- Group Filtering: Click on a group in the left-side group tree to filter files in that group.
- Delete: Select files and click the "Delete" button.
File Grouping
- The system automatically groups files by date (configured via
FileSettings:DateTimeDirectory, defaultyyyy/MM/dd). - You can also manually select a group during upload.
- The left-side tree group navigation allows quick switching of file views.
Image Processing
Uploaded images automatically undergo the following processing:
- Format validation (via ImageSharp to check if it's a valid image)
- Size compression (automatically scales down if exceeding the configured maximum width)
- Format conversion (automatically converts to WebP format, with the option to keep the original file)
Multi-Tenant File Isolation
When multi-tenant is enabled, the file storage path is automatically prefixed with the tenant code: wwwroot/uploads/{tenantCode}/yyyy/MM/dd/, ensuring physical file isolation between different tenants.
Interface Description
Left Group Tree
- Displays all file group directories
- Click to filter the file list
Upload Area
- CardUpload card upload component
- Supports drag-and-drop upload and click selection
- Automatically displays upload progress
File List
- File Name: Original file name (with icon indicating file type)
- Size: Formatted file size
- Directory: Storage path
- Actions Column: Preview, Delete
Related Entities/Services
SysFile— File entityFileService— File upload, delete, and image processing serviceIConfiguration— Reads file configuration (allowed extensions, size limits, WebP quality, etc.)