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