Blazor File and directory browser - Open PDF files

Hello,

I have a question for the Radzen.Blazor File and directory browser (RadzenTree). Is it possible to open a file from the server with the component?

Is there a URL property or a Download function?

I tryed to to set a HTML Link into the TreeExpandEventArgs children.Text but the HTML don't work. The text is shown raw:

nodeText = "<a href="W3Schools Online Web Tutorials">Visit W3Schools.com!";

grafik

Is it possible to open a (PDF) file?

Regards Ringo

This thread might help you:

I got a solution. No controller, no special download method, just a href link which I set in this method. It works fine:

private RenderFragment<RadzenTreeItem> TreeItemTemplate => context => __builder =>
{
        @if (IsFile(context.Value))
        {
            <RadzenIcon Icon="insert_drive_file" />
            <p><a href="@GetUrlForNode(context.Value)" target="=_blank"><b>@context.Text.Substring(4)</b></a></p>
        }
        else

In this methode it works to format the content.

Now I have a further problem with updating files. If the files are already in the development project the link works. If I put a new file on the server the tree has the file, the link will be generated correctly but an error occurs when opening:


The error:

The file is there. The url ist correct. The rights should be ok but it cannot be downloaded!
Ist there a setting to allow to download the added or updated files?

Regards
Ringo

I’m afraid that I’ve never seen such error before and I don’t know how to solve it.