New to Telerik UI for Blazor? Start a free 30-day trial

FileManager Upload

Updated on Oct 1, 2026

The FileManager allows uploading of files through an integrated Upload component. The Upload shows in a dialog when the user clicks on the Upload Toolbar button.

Before you continue, make sure you are familiar with the features and API of the Telerik Upload component.

Configure the integrated Upload through the FileManagerUploadSettings child tag of FileManagerSettings. The FileManager exposes parameter names that are identical to the respective Upload component API members:

Example

The example below demonstrates how to handle successful uploads in the FileManager. Note the following milestones:

The FileManagerController class below assumes that the project name and namespace is TelerikBlazorApp. The FileManager Data is the contents of the application's wwwroot folder.

Using FileManager Upload

Example
View Source
Loading ...
C#
using Microsoft.AspNetCore.Mvc;

namespace TelerikBlazorApp.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class FileManagerController : ControllerBase
    {
        public IWebHostEnvironment HostingEnvironment { get; set; }

        public FileManagerController(IWebHostEnvironment hostingEnvironment)
        {
            HostingEnvironment = hostingEnvironment;
        }

        [HttpPost]
        public async Task<IActionResult> Save(IFormFile files, [FromForm] string fileManagerPath)
        {
            if (files != null)
            {
                try
                {
                    if (fileManagerPath.StartsWith("/"))
                    {
                        // Path.Combine ignores the first argument if the second one is an absolute path
                        fileManagerPath = fileManagerPath.Substring(1);
                    }

                    var saveLocation = Path.Combine(new string[] { HostingEnvironment.WebRootPath, fileManagerPath, files.FileName });

                    using (var fileStream = new FileStream(saveLocation, FileMode.Create))
                    {
                        await files.CopyToAsync(fileStream);
                    }
                }
                catch (Exception ex)
                {
                    Response.StatusCode = 500;
                    await Response.WriteAsync($"Upload failed: {ex.Message}");
                }
            }

            return new EmptyResult();
        }

        [HttpPost]
        public async Task<IActionResult> Remove([FromForm] string files, [FromForm] string fileManagerPath)
        {
            if (files != null)
            {
                try
                {
                    if (fileManagerPath.StartsWith("/"))
                    {
                        fileManagerPath = fileManagerPath.Substring(1);
                    }

                    var fileLocation = Path.Combine(HostingEnvironment.WebRootPath, fileManagerPath, files);

                    if (System.IO.File.Exists(fileLocation))
                    {
                        System.IO.File.Delete(fileLocation);
                    }
                }
                catch (Exception ex)
                {
                    Response.StatusCode = 500;
                    await Response.WriteAsync($"Delete failed: {ex.Message}");
                }
            }

            return new EmptyResult();
        }
    }
}

When uploading multiple files at the same time, you may want to optimize the logic that reloads the FileManager Data in the Upload OnSuccess handler, so that it executes just once after all files have been uploaded.

Next Steps

See Also

In this article
ExampleNext StepsSee Also
Not finding the help you need?
Contact Support