Get upload name on template form

Is it possible to get the name of a file that was loaded into a file input form template?
I tried using the image command on radzen, but it is protected. The only way I found the name of this file was with this code, would it have another way?

The command I tried:

The result that I want to reach

Unfortunately this is not supported at the moment. We will introduce a new event of the FileInput component that will provide the file the user has chosen (filename and all). Then you will be able to use a Set property action and store the filename in a page property.

I'm waiting, thanks @korchev !

I had the same question about storing the file name. Glad to know I wasn't the only one. How do you download a copy of the file that was attached? I can do this with a save as on a photo but for PDF/Excel files I can upload but I can't get them back out. Also if there a way to handle multiple files with this control?

Josh

The FileInput component is meant to be used as a part of a form and stores the selected file as a property (column) in the entity (table) which the form is editing. This is the reason it accepts only one file - a table row can have only one value for a column. Downloading the uploaded file isn't something that Radzen provides out of the box. Still I think one can create a custom controller which reads the file from the database and streams it back to the user.

The Upload component on the other hand allows you to select multiple files and store them the way you want - in the file system, in the database etc.

The key here is that FileInput does not replace Upload - it is a way to automatically store files as part of form submission (without requiring custom file storage logic).

Hope this helps!

Hello Josh, What you need would be the download? if you are in dateURL just put in a template a tag "a" with the href with the href pointing to the file dataURL

Forgot to update the thread. The FileInput component now has a Select event which provides the File that the user selected. You can get the file name using ${event.file.name}

I can't find Select event in FileInput. Is there a way to get a file name from fileinput component?

@Michaelly this thread is for Angular. You seem to be using Blazor.