Hi @mcanavar,
Radzen does not support this out of the box. You can however use a custom server method for that (or create another controller). Here is a sample implementation of such a method (inspired by this SO question):
[Route("api/[controller]/[action]")]
public class ServerMethodsController
{
// Inject a EF context to your database
// Check https://www.radzen.com/documentation/invoke-custom-method/#create-the-custom-method-that-executes-the-db-query
MyDataSourceContext context;
public ServerMethodsController(MyDataSourceContext context)
{
this.context = context;
}
[HttpGet("download")]
public IActionResult GetBlobDownload([FromQuery] string fileName)
{
// Find the local file name from the DB
var file = context.Files.Where(file => file.FileName == fileName).FirstOrDefault();
if (file == null || !File.Exists(file.FileName))
{
return NotFound();
}
// Get a stream to the file
using var content = System.IO.File.OpenRead(file.FileName);
// Return the file
return File(content, "application/octet-stream", fileName);
}
}
Then to use it in your Angular pages create links to '/api/servermethods/download?fileName=<required filename>'
for example '/api/servermethods/download?fileName=test.xlsx'