Fileinput cannot upload some images

Hi,
I'm try to use fileinput component
In my project, fileinput return Unable to read file as base64 string. A task was canceled.
then Attempting to reconnect to the server..

but it work on blazor.radzen.com/fileinput(same image and same code)

Is there any mistake in this?

Such error might happen if the image is too big

thank you
but only about 100kb image(?
And why doesn't this error occur on the sample page?

I’m afraid that in this case I don’t have any other ideas.

I try to find the limit
and I found that the largest file uploaded was 24513 bytes(about 23.9kb)
I don't know what's special about it

Try increasing the Hub options limit:

3 Likes

It works!
Thank you very much.!

I am having this same issue. The same image works fine in the sample page for that component. Using AddHubOptions did not change the outcome. Is there any explanation for this discrepency?

My reply is from 4 years ago and Blazor has changed quite a lot since then :slight_smile: Here is the up-to-date code:

1 Like

What error would we catch and handle if the user does select a file that is too large?

When I was running into this error it seemed to be failing silently.

Maybe you can use MaxFileSize to restrict bigger images.

I believe, even with a small MaxFileSize, there is no feedback when the file is selected. (unless there is, and I'm looking in the wrong place).