Get Filename with FileInput

Folks,

When i use the FileInput component I can see the file name as a tooltip after I input a file but how do I get this file name to save to the db? I have tried to access this property via the FileinputChange event but this throws an error 'cannot convert from method group to event callback'

What am i missing?

thanks

John

Hi @johnmu,

This isn't currently supported. The Value of the FileInput is the base64 encoded DATA URI of the selected file. It does not contain the file name. You will need the FileUpload component if you want to get the original file name.

Hello! You wrote "This isn't currently supported. ...". That was back in March 2021. Have there been any changes in this direction since then? I'm still having trouble saving the file name instead of "base64".
So that you understand: I'm still learning, but I don't have a high degree of programming skills.

Hi @Alexander_Stain,

Yes, you can now get the filename easily:

<RadzenFileInput @bind-FileName="@fileName" @bind-Value="@value"  />

@code {
   string fileName;
   string value;
}
1 Like

Thank you very much! That's what you need!