Select theme:
Radzen Blazor Studio has replaced Radzen as the primary RAD tool for Blazor applications.
Radzen Blazor Studio offers a modern UI, enhanced features, and improved performance to streamline your development process.
The latest documentation for Radzen Blazor Studio is available here: https://www.radzen.com/blazor-studio/documentation/
Open Radzen Blazor Studio docsEnd of Year Promotion: Save $100 with code CHEERS2026 — valid until January 10, 2026. See Pricing
This guide demonstrates how to copy and download file when deploying application.
1. Create new Blazor application.

2. Add desired file(s) in server folder [APP_NAME].csproj file
<ItemGroup>
<None Include="ProductSales.pdf" CopyToPublishDirectory="Always" />
...

3. Execute custom method to download the file.

MainPage.razor.cs
using System.Threading.Tasks;
namespace SampleBlazor.Pages
{
public partial class MainPageComponent
{
public async Task GetFile(string fileName)
{
UriHelper.NavigateTo($"api/custommethod/getfile?fileName={fileName}", true);
}
}
}

CustomController.cs
using System.IO;
using Microsoft.AspNetCore.Mvc;
namespace SampleBlazor
{
[Route("api/[controller]/[action]")]
public class CustomMethodController : Controller
{
[HttpGet]
public IActionResult GetFile(string fileName)
{
if (System.IO.File.Exists(fileName))
{
return File(System.IO.File.ReadAllBytes(fileName), contentType: "application/pdf", fileName);
}
return NotFound();
}
}
}
4. Run the application and download file.

Radzen is free to use. You can also test the premium features for 15 days.
Start FreeSelect theme: