Repository Description
This repository contains the ASP.NET Core file system providers for the Syncfusion Essential JS 2 File Manager component. These providers expose server‑side APIs that allow the File Manager UI to interact with the physical file system for common file operations.
The ASP.NET Core file system provider enables secure access to directories and supports a wide range of file management actions required by the File Manager component.
The purpose of this project is to provide a backend implementation for the Syncfusion Essential JS 2 File Manager component using ASP.NET Core. It demonstrates how to handle file system operations such as reading files, uploading content, renaming items, and managing folders through REST‑style APIs.
Ensure the following requirements are met before running this project:
- Visual Studio
- .NET SDK compatible with ASP.NET Core
- Basic knowledge of ASP.NET Core Web APIs
A file system provider is an API for access to the physical file system in the FileManager control. It also provides the methods for performing various file actions like creating a new folder, renaming files and deleting files.
ASP.NET Core file system provider serves the physical file system for the file manager component.
The following actions can be performed with ASP.NET Core file system Provider.
| Action | Description |
|---|---|
| Read | Reads files from the local file storage. |
| Details | Retrieves file metadata, including Type, Size, Location, and Modified Date. |
| Download | Downloads the selected file or folder. |
| Upload | Uploads files with the following constraints:
|
| Create | Creates a new folder. |
| Delete | Deletes a file or folder. |
| Copy | Copies files or folders from the source location. |
| Move | Moves (pastes) copied files or folders to the target location. |
| Rename | Renames a file or folder. |
| Search | Searches for files or folders. |
To run this application, you need to first clone the ej2-aspcore-file-provider repository and then navigate to its appropriate path where it has been located in your system.
To do so, open the command prompt and run the below commands one after the other.
git clone https://github.com/SyncfusionExamples/ej2-aspcore-file-provider ej2-aspcore-file-provider
cd ej2-aspcore-file-provider
Once cloned, open solution file in visual studio.Then build the project after restoring the nuget packages and run it.
To access the basic actions such as Read, Delete, Copy, Move, Rename, Search, and Get Details of File Manager using Azure service, just map the following code snippet in the Ajaxsettings property of File Manager.
Here, the hostUrl will be your locally hosted port number.
var hostUrl = http://localhost:62870/;
ajaxSettings: {
url: hostUrl + 'api/FileManager/FileOperations'
}
To perform download operation, initialize the downloadUrl property in ajaxSettings of the File Manager component.
var hostUrl = http://localhost:62870/;
ajaxSettings: {
url: hostUrl + 'api/FileManager/FileOperations',
downloadUrl: hostUrl +'api/FileManager/Download'
}
To perform upload operation, initialize the uploadUrl property in ajaxSettings of the File Manager component.
var hostUrl = http://localhost:62870/;
ajaxSettings: {
url: hostUrl + 'api/FileManager/FileOperations',
uploadUrl: hostUrl +'api/FileManager/Upload'
}
To perform image preview support in the File Manager component, initialize the getImageUrl property in ajaxSettings of the File Manager component.
var hostUrl = http://localhost:62870/;
ajaxSettings: {
url: hostUrl + 'api/FileManager/FileOperations',
getImageUrl: hostUrl +'api/FileManager/GetImage'
}
The FileManager will be rendered as the following.
- General Syncfusion documentation: https://help.syncfusion.com/
- Essential JS 2 File Manager – Getting Started: https://ej2.syncfusion.com/documentation/file-manager/
- Syncfusion File Manager product overview: https://www.syncfusion.com/javascript-ui-controls/js-file-manager
- Ensure the API URLs in ajaxSettings match the running server port.
- Verify file system permissions for read/write operations.
- Rebuild the solution if API endpoints fail to respond.
Product support is available for through following mediums.
- Creating incident in Syncfusion Direct-trac support system or Community forum.
- New GitHub issue.
- Ask your query in Stack Overflow with tag
syncfusionandej2.
Check the license detail here.
Check the changelog here
© Copyright 2019 Syncfusion, Inc. All Rights Reserved. The Syncfusion Essential Studio license and copyright applies to this distribution.
