Radzen FileInput questions and comments

Hi,

I am trying to use the FileInput razor/blazor component and I have a couple of Q's and observations.

1.) How can I disable the "image preview" option? Since I wish to upload arbitrary text and/or binary files the image previewer is neither wanted nor necessary. I've tried setting the "accept" parameter to various things, but it seems to have no effect.

2.) The "image previewer" has a "close" button associated with it. When I click on the "Close" button and kill the previewer the FileInput control then becomes non-functional. By this I mean that while one can still select files to upload the component no-longer fires off the change event. There is, therefore, no way to detect when a file has been specified. There seems to be no programmatic way to enable/disable the previewer so the control is broken until I reload the page or restart the application.

3.) When uploading large files that may take a considerable time to upload is there any way to check on the progress of the upload or to fire-off a "progress delegate" or to even detect when the upload is complete?

Thanks,
H

Hi,

  1. Not possible at the moment. We will add such option in one of the future releases.
  2. You are right! I'll check what's going on and I'll publish fix later today.
  3. We are using FileInput as a Form component to submit relatively small files as base64 string in a database. We've just added Upload component that can be used to upload any files however progress is not supported since the upload is native handled by the browser.

Best Regards,
Vladimir

I've just published new version of Radzen.Blazor with progress support for the Upload component:

Thank you for your quick response! I'll look into the Upload Component.

H

In your code snippet:

int progress;
string info;

void OnProgress(UploadProgressArgs args, string name)
{
    this.info = $"% '{name}' / {args.Loaded} of {args.Total} bytes.";
    this.progress = args.Progress;
}

There is no supplied definition for UploadProgressArgs. What would you suggest for it's implementation?

H

Oops: Never mind. I discovered Radzen.UploadProgressArgs.

Works like a charm! Thank you for your efforts and a great product!

H

2 Likes