Implementing Syncfusion Blazor FileManager
When to Use This Skill
Use this skill when you need to:
- Create a file management interface - Build web applications for browsing, uploading, downloading, and managing files
- Set up cloud storage integration - Connect to Azure Blob Storage, Amazon S3, Google Drive, SharePoint, or Firebase
- Implement file operations - Enable users to create, delete, rename, copy, move, search files and folders
- Handle large file sets - Display thousands of files with virtualization and pagination
- Customize the UI - Tailor toolbar, context menu, views, and navigation to your needs
- Add drag-and-drop functionality - Allow users to drag and drop files for upload or organization
- Build accessible file systems - Provide WCAG-compliant file management with keyboard navigation
- Handle complex workflows - Implement custom sorting, filtering, previewing, and multi-provider scenarios
Component Overview
The Syncfusion Blazor FileManager is a comprehensive component for file and folder management. It provides:
- Multiple file operations: Read, Create, Delete, Rename, Search, Copy, Move, Upload, Download, Get Details, GetSelectedFiles
- Flexible data binding: AJAX settings, list objects, or injected services
- Rich events system: 20+ events including PageChanging/PageChanged for pagination
- Multiple UI customizations: Toolbar, context menu, view modes (Details, LargeIcons), NavigationPaneTemplate
- File preview capabilities: ShowThumbnail property for image and file previews
- Cloud provider support: Physical files, Azure, AWS S3, Google Drive, SharePoint, Firebase, SQL, FTP
- Advanced features: Virtualization, pagination with events, drag-and-drop, custom filtering, sorting, accessibility
- Layout management: RefreshLayoutAsync for dynamic resizing and nested component scenarios
- High performance: Handles large file sets with virtualization and lazy loading
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Installation for Web App, Server App, WASM App, and MAUI App
- NuGet package setup and service registration
- Basic component initialization and AJAX configuration
- File provider setup and wwwroot configuration
- First file manager instance in 5 minutes
File Operations
📄 Read: references/file-operations.md
- 11 core operations: Read, Create, Delete, Rename, Search, Details, Copy, Move, Upload, Download, GetImage
- Request/response data structures and parameters
- Operation examples with code from documentation
- Public methods:
DownloadFilesAsync(selectedItems), GetSelectedFiles()
- File preview capabilities with
ShowThumbnail property
- Sorting functionality with SortBy and SortOrder properties
Data Binding Patterns
📄 Read: references/data-binding.md
- AjaxSettings for remote data binding
- List objects with local data and OnRead event
- Injected service pattern for complex scenarios
- FileManagerDirectoryContent structure
- When to use each binding method
Events and Callbacks
📄 Read: references/events-and-callbacks.md
- 20+ file manager events with complete signatures
- Event lifecycle and timing
- Common event handler patterns
- BeforeDownload, BeforeImageLoad, OnFileOpen events
- ItemsDeleting, ItemsDeleted, FolderCreating, FolderCreated events
- Searching, Searched, ItemRenaming, ItemRenamed events
Customization and UI
📄 Read: references/customization.md
- Toolbar customization and item configuration
- Context menu customization
- View modes: Details View, LargeIcons View
- Navigation items customization with NavigationPaneTemplate
- Custom navigation pane templates with icons and metadata
- Styling and CSS customization
- Appearance and theme configuration
File Providers and Storage
📄 Read: references/file-providers.md
- Physical file provider (local file system)
- Azure Blob Storage configuration
- Amazon S3 cloud provider
- Google Drive integration
- SharePoint Online provider
- Firebase Real-time Database
- SQL Database provider
- FTP (File Transfer Protocol) provider
Upload and Download
📄 Read: references/upload-download.md
- File upload configuration and events
- Directory upload (folder upload)
- File download with single and ZIP support
- Large file handling
- Upload progress tracking
- Download prevention and validation
- BeforeDownload event for custom logic
Advanced Features
📄 Read: references/advanced-features.md
- Virtualization for large file sets
- Pagination configuration with PageChanging and PageChanged events
- Drag and drop functionality
- Restrict drag-and-drop upload
- Custom filtering and search
- Nested items handling with RefreshLayoutAsync method
- Component integration in dialogs and containers
- Accessibility features (WCAG compliance)
- Keyboard navigation support
- Multiple file selection
Quick Start Example
@using Syncfusion.Blazor.FileManager
<SfFileManager TValue="FileManagerDirectoryContent">
<FileManagerAjaxSettings Url="/api/FileManager/FileOperations"
UploadUrl="/api/FileManager/Upload"
DownloadUrl="/api/FileManager/Download"
GetImageUrl="/api/FileManager/GetImage">
</FileManagerAjaxSettings>
</SfFileManager>
Server-side setup (Program.cs):
using Syncfusion.Blazor;
builder.Services.AddSyncfusionBlazor();
builder.Services.AddControllers();
app.UseRouting();
app.MapControllers();
HTML setup (App.razor):
<head>
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
</head>
<body>
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>
</body>
Common Patterns
Pattern 1: Local Data with OnRead Event
<SfFileManager TValue="FileManagerDirectoryContent">
<FileManagerEvents TValue="FileManagerDirectoryContent"
</SfFileManager>
@code {
private async Task OnReadAsync(ReadEventArgs<FileManagerDirectoryContent> args)
{
// Load data from your service
var response = await YourService.GetFilesAsync(args.Path);
args.Response = response;
}
}
Pattern 2: Cloud Storage with Azure Provider
<SfFileManager TValue="FileManagerDirectoryContent">
<FileManagerAjaxSettings Url="/api/AzureProvider/FileOperations"
UploadUrl="/api/AzureProvider/Upload"
DownloadUrl="/api/AzureProvider/Download"
GetImageUrl="/api/AzureProvider/GetImage">
</FileManagerAjaxSettings>
</SfFileManager>
Pattern 3: Programmatic Download
@ref="FileManager"
<SfButton Selected</SfButton>
<SfFileManager @ref="FileManager" TValue="FileManagerDirectoryContent">
<!-- configuration -->
</SfFileManager>
@code {
SfFileManager<FileManagerDirectoryContent> FileManager;
public async Task DownloadFiles()
{
await FileManager.DownloadFilesAsync(FileManager.SelectedItems);
}
}
Pattern 4: Custom Event Handling
<SfFileManager TValue="FileManagerDirectoryContent">
<FileManagerEvents TValue="FileManagerDirectoryContent"
ItemsDeleting="OnItemsDeleting"
BeforeDownload="OnBeforeDownload">
</FileManagerEvents>
</SfFileManager>
@code {
public async Task OnItemsDeleting(ItemsDeleteEventArgs<FileManagerDirectoryContent> args)
{
// Validate before delete
if (args.Files.Count > 10)
{
args.Cancel = true;
}
}
public void OnBeforeDownload(BeforeDownloadEventArgs<FileManagerDirectoryContent> args)
{
// Custom download logic
}
}
Key Properties
| Property |
Type |
Default |
Purpose |
TValue |
Generic |
FileManagerDirectoryContent |
Data model type |
Url |
string |
- |
AJAX endpoint for file operations |
UploadUrl |
string |
- |
Upload endpoint |
DownloadUrl |
string |
- |
Download endpoint |
GetImageUrl |
string |
- |
Image preview endpoint |
SortBy |
string |
Name |
Sort field (Name, Size, DateModified, DateCreated) |
SortOrder |
SortOrder |
Ascending |
Sort direction (None, Ascending, Descending) |
View |
ViewType |
LargeIcons |
Display mode (Details, LargeIcons) |
EnableVirtualization |
bool |
false |
Enable virtual scrolling for large datasets |
RootPath |
string |
- |
Root directory path |
ShowHiddenItems |
bool |
false |
Show hidden files and folders |
EnablePagination |
bool |
false |
Enable pagination support |
PageSize |
int |
100 |
Number of items per page |
DirectoryUpload |
bool |
false |
Allow directory upload |
Common Use Cases
1. Internal Document Management
- Setup with physical file provider
- Use toolbar for CRUD operations
- Enable search and filtering
- Add event handlers for audit logging
2. Cloud-Based Team Collaboration
- Connect to Azure or AWS S3
- Enable drag-and-drop upload
- Add custom toolbar for sharing
- Implement access control via events
3. Media Library
- Enable image preview with GetImageUrl
- Use LargeIcons view for thumbnails
- Implement pagination for performance
- Add custom filtering by file type
4. Backup and Archive System
- Connect to multiple storage providers
- Enable download with compression
- Use virtualization for large datasets
- Add custom sorting and filtering
5. Public File Sharing Portal
- Restrict operations via event handlers
- Disable delete and rename
- Enable download and preview only
- Customize navigation and UI
Next Steps
- Choose your setup: Start with Getting Started for your platform
- Pick your data source: Read Data Binding Patterns to choose AJAX, local, or service
- Configure file operations: Check File Operations for available actions
- Handle events: Review Events and Callbacks for required handlers
- Customize UI: See Customization for toolbar and themes
- Choose storage: Select provider in File Providers
1---
2name: syncfusion-blazor-file-manager
3description: Implement Syncfusion Blazor FileManager component for file browsing and management. Use this when creating hierarchical file systems, handling multiple file operations, implementing data binding patterns, or setting up cloud provider integration. This skill covers file operations, data binding, events handling, and customization options.
4metadata:
5 author: "Syncfusion Inc"
6 version: "34.1.29"
7 category: "File Management"
8---
9
10# Implementing Syncfusion Blazor FileManager
11
12## When to Use This Skill
13
14Use this skill when you need to:
15
16- **Create a file management interface** - Build web applications for browsing, uploading, downloading, and managing files
17- **Set up cloud storage integration** - Connect to Azure Blob Storage, Amazon S3, Google Drive, SharePoint, or Firebase
18- **Implement file operations** - Enable users to create, delete, rename, copy, move, search files and folders
19- **Handle large file sets** - Display thousands of files with virtualization and pagination
20- **Customize the UI** - Tailor toolbar, context menu, views, and navigation to your needs
21- **Add drag-and-drop functionality** - Allow users to drag and drop files for upload or organization
22- **Build accessible file systems** - Provide WCAG-compliant file management with keyboard navigation
23- **Handle complex workflows** - Implement custom sorting, filtering, previewing, and multi-provider scenarios
24
25## Component Overview
26
27The **Syncfusion Blazor FileManager** is a comprehensive component for file and folder management. It provides:
28
29- **Multiple file operations**: Read, Create, Delete, Rename, Search, Copy, Move, Upload, Download, Get Details, GetSelectedFiles
30- **Flexible data binding**: AJAX settings, list objects, or injected services
31- **Rich events system**: 20+ events including PageChanging/PageChanged for pagination
32- **Multiple UI customizations**: Toolbar, context menu, view modes (Details, LargeIcons), NavigationPaneTemplate
33- **File preview capabilities**: ShowThumbnail property for image and file previews
34- **Cloud provider support**: Physical files, Azure, AWS S3, Google Drive, SharePoint, Firebase, SQL, FTP
35- **Advanced features**: Virtualization, pagination with events, drag-and-drop, custom filtering, sorting, accessibility
36- **Layout management**: RefreshLayoutAsync for dynamic resizing and nested component scenarios
37- **High performance**: Handles large file sets with virtualization and lazy loading
38
39## Documentation and Navigation Guide
40
41### Getting Started
42📄 **Read:** [references/getting-started.md](references/getting-started.md)
43- Installation for Web App, Server App, WASM App, and MAUI App
44- NuGet package setup and service registration
45- Basic component initialization and AJAX configuration
46- File provider setup and wwwroot configuration
47- First file manager instance in 5 minutes
48
49### File Operations
50📄 **Read:** [references/file-operations.md](references/file-operations.md)
51- 11 core operations: Read, Create, Delete, Rename, Search, Details, Copy, Move, Upload, Download, GetImage
52- Request/response data structures and parameters
53- Operation examples with code from documentation
54- Public methods: `DownloadFilesAsync(selectedItems)`, `GetSelectedFiles()`
55- File preview capabilities with `ShowThumbnail` property
56- Sorting functionality with SortBy and SortOrder properties
57
58### Data Binding Patterns
59📄 **Read:** [references/data-binding.md](references/data-binding.md)
60- AjaxSettings for remote data binding
61- List objects with local data and OnRead event
62- Injected service pattern for complex scenarios
63- FileManagerDirectoryContent structure
64- When to use each binding method
65
66### Events and Callbacks
67📄 **Read:** [references/events-and-callbacks.md](references/events-and-callbacks.md)
68- 20+ file manager events with complete signatures
69- Event lifecycle and timing
70- Common event handler patterns
71- BeforeDownload, BeforeImageLoad, OnFileOpen events
72- ItemsDeleting, ItemsDeleted, FolderCreating, FolderCreated events
73- Searching, Searched, ItemRenaming, ItemRenamed events
74
75### Customization and UI
76📄 **Read:** [references/customization.md](references/customization.md)
77- Toolbar customization and item configuration
78- Context menu customization
79- View modes: Details View, LargeIcons View
80- Navigation items customization with NavigationPaneTemplate
81- Custom navigation pane templates with icons and metadata
82- Styling and CSS customization
83- Appearance and theme configuration
84
85### File Providers and Storage
86📄 **Read:** [references/file-providers.md](references/file-providers.md)
87- Physical file provider (local file system)
88- Azure Blob Storage configuration
89- Amazon S3 cloud provider
90- Google Drive integration
91- SharePoint Online provider
92- Firebase Real-time Database
93- SQL Database provider
94- FTP (File Transfer Protocol) provider
95
96### Upload and Download
97📄 **Read:** [references/upload-download.md](references/upload-download.md)
98- File upload configuration and events
99- Directory upload (folder upload)
100- File download with single and ZIP support
101- Large file handling
102- Upload progress tracking
103- Download prevention and validation
104- BeforeDownload event for custom logic
105
106### Advanced Features
107📄 **Read:** [references/advanced-features.md](references/advanced-features.md)
108- Virtualization for large file sets
109- Pagination configuration with PageChanging and PageChanged events
110- Drag and drop functionality
111- Restrict drag-and-drop upload
112- Custom filtering and search
113- Nested items handling with RefreshLayoutAsync method
114- Component integration in dialogs and containers
115- Accessibility features (WCAG compliance)
116- Keyboard navigation support
117- Multiple file selection
118
119## Quick Start Example
120
121```razor
122@using Syncfusion.Blazor.FileManager
123
124<SfFileManager TValue="FileManagerDirectoryContent">
125 <FileManagerAjaxSettings Url="/api/FileManager/FileOperations"
126 UploadUrl="/api/FileManager/Upload"
127 DownloadUrl="/api/FileManager/Download"
128 GetImageUrl="/api/FileManager/GetImage">
129 </FileManagerAjaxSettings>
130</SfFileManager>
131```
132
133**Server-side setup (Program.cs):**
134```csharp
135using Syncfusion.Blazor;
136
137builder.Services.AddSyncfusionBlazor();
138builder.Services.AddControllers();
139
140app.UseRouting();
141app.MapControllers();
142```
143
144**HTML setup (App.razor):**
145```html
146<head>
147 <link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
148</head>
149<body>
150 <script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>
151</body>
152```
153
154## Common Patterns
155
156### Pattern 1: Local Data with OnRead Event
157```razor
158<SfFileManager TValue="FileManagerDirectoryContent">
159 <FileManagerEvents TValue="FileManagerDirectoryContent" OnRead="OnReadAsync"></FileManagerEvents>
160</SfFileManager>
161
162@code {
163 private async Task OnReadAsync(ReadEventArgs<FileManagerDirectoryContent> args)
164 {
165 // Load data from your service
166 var response = await YourService.GetFilesAsync(args.Path);
167 args.Response = response;
168 }
169}
170```
171
172### Pattern 2: Cloud Storage with Azure Provider
173```razor
174<SfFileManager TValue="FileManagerDirectoryContent">
175 <FileManagerAjaxSettings Url="/api/AzureProvider/FileOperations"
176 UploadUrl="/api/AzureProvider/Upload"
177 DownloadUrl="/api/AzureProvider/Download"
178 GetImageUrl="/api/AzureProvider/GetImage">
179 </FileManagerAjaxSettings>
180</SfFileManager>
181```
182
183### Pattern 3: Programmatic Download
184```razor
185@ref="FileManager"
186
187<SfButton OnClick="DownloadFiles">Download Selected</SfButton>
188<SfFileManager @ref="FileManager" TValue="FileManagerDirectoryContent">
189 <!-- configuration -->
190</SfFileManager>
191
192@code {
193 SfFileManager<FileManagerDirectoryContent> FileManager;
194
195 public async Task DownloadFiles()
196 {
197 await FileManager.DownloadFilesAsync(FileManager.SelectedItems);
198 }
199}
200```
201
202### Pattern 4: Custom Event Handling
203```razor
204<SfFileManager TValue="FileManagerDirectoryContent">
205 <FileManagerEvents TValue="FileManagerDirectoryContent"
206 ItemsDeleting="OnItemsDeleting"
207 BeforeDownload="OnBeforeDownload">
208 </FileManagerEvents>
209</SfFileManager>
210
211@code {
212 public async Task OnItemsDeleting(ItemsDeleteEventArgs<FileManagerDirectoryContent> args)
213 {
214 // Validate before delete
215 if (args.Files.Count > 10)
216 {
217 args.Cancel = true;
218 }
219 }
220
221 public void OnBeforeDownload(BeforeDownloadEventArgs<FileManagerDirectoryContent> args)
222 {
223 // Custom download logic
224 }
225}
226```
227
228## Key Properties
229
230| Property | Type | Default | Purpose |
231|----------|------|---------|---------|
232| `TValue` | Generic | FileManagerDirectoryContent | Data model type |
233| `Url` | string | - | AJAX endpoint for file operations |
234| `UploadUrl` | string | - | Upload endpoint |
235| `DownloadUrl` | string | - | Download endpoint |
236| `GetImageUrl` | string | - | Image preview endpoint |
237| `SortBy` | string | Name | Sort field (Name, Size, DateModified, DateCreated) |
238| `SortOrder` | SortOrder | Ascending | Sort direction (None, Ascending, Descending) |
239| `View` | ViewType | LargeIcons | Display mode (Details, LargeIcons) |
240| `EnableVirtualization` | bool | false | Enable virtual scrolling for large datasets |
241| `RootPath` | string | - | Root directory path |
242| `ShowHiddenItems` | bool | false | Show hidden files and folders |
243| `EnablePagination` | bool | false | Enable pagination support |
244| `PageSize` | int | 100 | Number of items per page |
245| `DirectoryUpload` | bool | false | Allow directory upload |
246
247## Common Use Cases
248
249**1. Internal Document Management**
250- Setup with physical file provider
251- Use toolbar for CRUD operations
252- Enable search and filtering
253- Add event handlers for audit logging
254
255**2. Cloud-Based Team Collaboration**
256- Connect to Azure or AWS S3
257- Enable drag-and-drop upload
258- Add custom toolbar for sharing
259- Implement access control via events
260
261**3. Media Library**
262- Enable image preview with GetImageUrl
263- Use LargeIcons view for thumbnails
264- Implement pagination for performance
265- Add custom filtering by file type
266
267**4. Backup and Archive System**
268- Connect to multiple storage providers
269- Enable download with compression
270- Use virtualization for large datasets
271- Add custom sorting and filtering
272
273**5. Public File Sharing Portal**
274- Restrict operations via event handlers
275- Disable delete and rename
276- Enable download and preview only
277- Customize navigation and UI
278
279## Next Steps
280
2811. **Choose your setup**: Start with [Getting Started](references/getting-started.md) for your platform
2822. **Pick your data source**: Read [Data Binding Patterns](references/data-binding.md) to choose AJAX, local, or service
2833. **Configure file operations**: Check [File Operations](references/file-operations.md) for available actions
2844. **Handle events**: Review [Events and Callbacks](references/events-and-callbacks.md) for required handlers
2855. **Customize UI**: See [Customization](references/customization.md) for toolbar and themes
2866. **Choose storage**: Select provider in [File Providers](references/file-providers.md)