SlideShare a Scribd company logo
4
Most read
5
Most read
7
Most read
Implementing a file manager
in ASP.NET Core 8.0
ASP.NET Core File Manager
Ever needed to manage files, accepts uploads and offer downloads in
your ASP.NET Core applications? You may need to display files to
users but with different permissions. For example while one user is
allowed to upload, the other user is allowed to download only. In
modern browsers it’s easier to handle uploads, compared to the past
however you still can’t upload huge files if you don’t configure your
server correctly and browsers still does not offer any UI for
managing files. What if you could integrate a file manager which is
customizable, has a modern slick look and can handle all this for
you?
This post will focus on ASP.NET Core File Manager which is best on
the market for this job, regarding performance and easy,
straightforward API. It also supports ASP.NET Classic for legacy
applications but in this post we will use the newest and best tech
ASP.NET Core.
Step 1 — Create an ASP.NET Core project
 Open Visual Studio 2022 and create a project by
selecting ASP.NET Core Web App (MVC) template. Other
ASP.NET Core templates can also be used but we will use
this template for this example.
 Give the project a name e.g. SampleFileManager.
 Choose .NET 8.0 as framework. Older .NET versions are
also supported but we will use current LTS version 8.0 for
this example.
Step 2 — Add the necessary NuGet packages
 Right-click on the project in Solution Explorer and select
Manage NuGet Packages.
 Search FileUltimate and install the found package.
Step 3 — Add the initialization code to ASP.NET Core
pipeline
 Open Program.cs of your project and copy only the marked
lines to the same location:
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
//----------------------
//Add GleamTech to the ASP.NET Core services container.
builder.Services.AddGleamTech();
//----------------------
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
}
//----------------------
//Register GleamTech to the ASP.NET Core HTTP request pipeline.
app.UseGleamTech();
//----------------------
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
 Program.cs of your project will look like this:
Step 4 — Create a view and controller which will host
the file manager
 Create MyFileManager.cshtml under ViewsHome and replace
the contents with the following:
@using GleamTech.AspNet.Core
@using GleamTech.FileUltimate.AspNet.UI
<!DOCTYPE html>
@{
var fileManager = new FileManager
{
Width = 800,
Height = 600,
Resizable = true
};
var rootFolder = new FileManagerRootFolder
{
Name = "A Root Folder",
Location = "~/MyRootFolder"
};
rootFolder.AccessControls.Add(new FileManagerAccessControl
{
Path = @"",
AllowedPermissions = FileManagerPermissions.Full
});
fileManager.RootFolders.Add(rootFolder);
}
<html>
<head>
<title>File Manager</title>
@this.RenderHead(fileManager)
</head>
<body>
@this.RenderBody(fileManager)
</body>
</html>
 Add a controller method with same name which loads our
view:
public class HomeController : Controller
{
public IActionResult MyFileManager()
{
return View();
}
}
Step 5 — Run solution
 Run solution which will also build the project.
 When browser is launched, as we didn’t add a link to our
view in home page, directly type to add our controller
url home/MyFileManager in the address bar (so it
reads https://localhost:7034/home/MyFileManager).
The output
FileManager is now rendered in our host view and loaded the given
root folder (which is empty for now). For uploading, you can drag
and drop files and folders from your desktop directly to folders in
FileManager. We can add many root folders to FileManager, each
with different permissions.
FileManagerRootFolder.Location property can be set to a web app
relative path (this example), a path on disk or network, an Azure
Blob container , an Amazon S3 bucket. This is possible by location
providers feature. Please refer to docs for more info and sample code
on this.
Additional information
 Video Tutorial
 Online Documentation
 Live Demo Examples

More Related Content

DOCX
Implementing a document viewer in ASP.NET Core 8.0
PDF
Rest web service_with_spring_hateoas
PDF
ASP.NET Identity
PDF
Java servlet technology
PDF
.NET Core, ASP.NET Core Course, Session 18
PPTX
ASP.NET Presentation
PPTX
AngularJS Fundamentals + WebAPI
PPT
New Features Of ASP.Net 4 0
Implementing a document viewer in ASP.NET Core 8.0
Rest web service_with_spring_hateoas
ASP.NET Identity
Java servlet technology
.NET Core, ASP.NET Core Course, Session 18
ASP.NET Presentation
AngularJS Fundamentals + WebAPI
New Features Of ASP.Net 4 0

Similar to Implementing a file manager in ASP.NET Core 8.0 (20)

PPTX
Introducing ASP.NET Core 2.0
PDF
sveltekit-en.pdf
PDF
Express node js
DOCX
Beginners introduction to asp.net
PDF
Andy Bosch - JavaServer Faces in the cloud
PPTX
Integrate any Angular Project into WebSphere Portal
PPT
ASP.NET AJAX with Visual Studio 2008
PDF
Murach: An introduction to web programming with ASP.NET Core MVC
PPTX
Learning ASP.NET 5 and MVC 6
PDF
Using HttpWatch Plug-in with Selenium Automation in Java
PPTX
Introduction-to-ASPNET-Core ASP.NET.pptx
PPTX
Usability AJAX and other ASP.NET Features
PPTX
Nodejs.meetup
PPTX
Background Tasks with Worker Service
PPT
Asp.net tips
PDF
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
PPT
Rails review
PDF
White Paper : ASP.NET Core AngularJs 2 and Prime
PPTX
Reactive application using meteor
PPTX
Getting started with hot towel spa
Introducing ASP.NET Core 2.0
sveltekit-en.pdf
Express node js
Beginners introduction to asp.net
Andy Bosch - JavaServer Faces in the cloud
Integrate any Angular Project into WebSphere Portal
ASP.NET AJAX with Visual Studio 2008
Murach: An introduction to web programming with ASP.NET Core MVC
Learning ASP.NET 5 and MVC 6
Using HttpWatch Plug-in with Selenium Automation in Java
Introduction-to-ASPNET-Core ASP.NET.pptx
Usability AJAX and other ASP.NET Features
Nodejs.meetup
Background Tasks with Worker Service
Asp.net tips
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Rails review
White Paper : ASP.NET Core AngularJs 2 and Prime
Reactive application using meteor
Getting started with hot towel spa
Ad

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
assetexplorer- product-overview - presentation
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPT
Introduction Database Management System for Course Database
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
history of c programming in notes for students .pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
VVF-Customer-Presentation2025-Ver1.9.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
assetexplorer- product-overview - presentation
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Wondershare Filmora 15 Crack With Activation Key [2025
PTS Company Brochure 2025 (1).pdf.......
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Introduction Database Management System for Course Database
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Understanding Forklifts - TECH EHS Solution
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Operating system designcfffgfgggggggvggggggggg
wealthsignaloriginal-com-DS-text-... (1).pdf
history of c programming in notes for students .pptx
Design an Analysis of Algorithms II-SECS-1021-03
Ad

Implementing a file manager in ASP.NET Core 8.0

  • 1. Implementing a file manager in ASP.NET Core 8.0 ASP.NET Core File Manager Ever needed to manage files, accepts uploads and offer downloads in your ASP.NET Core applications? You may need to display files to users but with different permissions. For example while one user is allowed to upload, the other user is allowed to download only. In modern browsers it’s easier to handle uploads, compared to the past however you still can’t upload huge files if you don’t configure your server correctly and browsers still does not offer any UI for managing files. What if you could integrate a file manager which is customizable, has a modern slick look and can handle all this for you?
  • 2. This post will focus on ASP.NET Core File Manager which is best on the market for this job, regarding performance and easy, straightforward API. It also supports ASP.NET Classic for legacy applications but in this post we will use the newest and best tech ASP.NET Core. Step 1 — Create an ASP.NET Core project  Open Visual Studio 2022 and create a project by selecting ASP.NET Core Web App (MVC) template. Other ASP.NET Core templates can also be used but we will use this template for this example.
  • 3.  Give the project a name e.g. SampleFileManager.  Choose .NET 8.0 as framework. Older .NET versions are also supported but we will use current LTS version 8.0 for this example.
  • 4. Step 2 — Add the necessary NuGet packages  Right-click on the project in Solution Explorer and select Manage NuGet Packages.  Search FileUltimate and install the found package.
  • 5. Step 3 — Add the initialization code to ASP.NET Core pipeline  Open Program.cs of your project and copy only the marked lines to the same location: var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); //---------------------- //Add GleamTech to the ASP.NET Core services container. builder.Services.AddGleamTech(); //---------------------- var app = builder.Build(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Home/Error"); } //---------------------- //Register GleamTech to the ASP.NET Core HTTP request pipeline. app.UseGleamTech(); //---------------------- app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); app.Run();
  • 6.  Program.cs of your project will look like this:
  • 7. Step 4 — Create a view and controller which will host the file manager  Create MyFileManager.cshtml under ViewsHome and replace the contents with the following: @using GleamTech.AspNet.Core @using GleamTech.FileUltimate.AspNet.UI <!DOCTYPE html> @{ var fileManager = new FileManager { Width = 800, Height = 600, Resizable = true }; var rootFolder = new FileManagerRootFolder { Name = "A Root Folder", Location = "~/MyRootFolder" }; rootFolder.AccessControls.Add(new FileManagerAccessControl { Path = @"", AllowedPermissions = FileManagerPermissions.Full }); fileManager.RootFolders.Add(rootFolder); } <html> <head> <title>File Manager</title> @this.RenderHead(fileManager) </head> <body> @this.RenderBody(fileManager) </body> </html>
  • 8.  Add a controller method with same name which loads our view: public class HomeController : Controller { public IActionResult MyFileManager() { return View(); } }
  • 9. Step 5 — Run solution  Run solution which will also build the project.  When browser is launched, as we didn’t add a link to our view in home page, directly type to add our controller url home/MyFileManager in the address bar (so it reads https://localhost:7034/home/MyFileManager).
  • 10. The output FileManager is now rendered in our host view and loaded the given root folder (which is empty for now). For uploading, you can drag and drop files and folders from your desktop directly to folders in FileManager. We can add many root folders to FileManager, each with different permissions. FileManagerRootFolder.Location property can be set to a web app relative path (this example), a path on disk or network, an Azure Blob container , an Amazon S3 bucket. This is possible by location providers feature. Please refer to docs for more info and sample code on this.
  • 11. Additional information  Video Tutorial  Online Documentation  Live Demo Examples