Decorating InputFile with Radzen element

I am working on a blazor server page which needs to upload a doc file and display it. I can't use radzen fileinput due to it's limitations and fileupload via a separate controller would just double the data traffic.

Is it possible to use a radzen button to control hidden InputFile control similar how mudblazor did it ?

No, it will not double any traffic. This is how file uploads usually work - by submitting them to a server endpoint.

We haven't tried that but you can easily test it.

yeah, my fault, thank you for moving it to Blazor.

I did a test for Blazor server when a file is uploaded to the controller and then it is returned back to the component. The transfer size was double of the files size in devtools network.

In mudblazor there is "for" attribute which initiate fileinput upload. Im not sure how to do this in Radzen

This will happen only if you return it back from the controller.

We are not familiar with mudblazor and don't know what the "for" attribute does. You can probably use a regular button and use the RadzenButton class names to achieve similar styling.

1 Like