Hello,
I am writing MAUI Blazor Hybrid app and use FileManager. I am following this example: https://blazor.syncfusion.com/documentation/file-manager/data-binding#list-objects
Seems when upload image in a folder control hit BeforeImageLoad unlimited times and freeze main app.
When I commend the code:
public async Task BeforeImageLoadAsync(BeforeImageLoadEventArgs<FileManagerDirectoryContent> args)
{
//var result = await _fileManagerService.GetImage(args.ImageUrl, false, args.FileDetails);
//result.FileStream.Position = 0;
//args.FileStream = result.FileStream;
}
Then hit it depend of the images. If I have 2 images will hit the method 2 times. Then the image thumbnails is ok.
But If I delete the method and not hit it at all the image thumbnails is not loaded.
Regards,
Prasanth Madhaiyan.
We have checked and considered the reported scenario “Facing an issue where the BeforeImageLoad event is being triggered continuously in the Blazor FileManager” as bug on our end. The fix for this issue will be included in the weekly patch release scheduled for April 29, 2025.
You can track the status of the fix through the following link.
Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.
Regards,
Prasanth Madhaiyan.
Great, thank you. And please add missing thumbnail if method is missing as per my image.
Regards,
Prasanth Madhaiyan.
Hello,
Yes I know how to resolve this when put an empty event. If have 1000 files in the folder FM control need to hit 1000 time this empty event to load default thumbnails. More logically will be when event is missing automatically to load default thumbnails and not to hit 1000 times an empty event. But ok.
Regards,
Dimitar
Regards,
Prasanth Madhaiyan.
Hi Dimitar,
Thanks for your patience.
We are glad to announce that our patch release (V29.1.40) has been rolled out successfully. The issue where “Facing an issue where the BeforeImageLoad event is being triggered continuously in the Blazor FileManager” has been resolved in this release.
To access this fix, we suggest you update the package to 29.1.40 and we include the sample in the latest version for your reference.
Sample : Attached as a zip file.
Release notes: https://blazor.syncfusion.com/documentation/release-notes/29.1.40?type=all#file-manager
Root cause : The reported issue occurs due to using the CopyToAsync method from the System.IO library to copy stream data.
Since the underlying stream does not support true asynchronous operations properly, the method does not return any data and the code following CopyToAsync is not executed. As a result, the event continues to trigger repeatedly without throwing any exceptions.
Regards,
Prasanth Madhaiyan.
Hi,
I am experiencing the same issue as Dimitar, and it was not resolved by updating to 29.1.40.
I have a FileManager with some events, one being the BeforeImageLoad event:
<FileManagerEvents
TValue="FileManagerDirectoryContent"
...
BeforeImageLoad="BeforeImageLoad"
/>
And then I have implemented my callback method like this:
async Task BeforeImageLoad(BeforeImageLoadEventArgs<FileManagerDirectoryContent> args)
{
args.UseImageAsUrl = false;
var thumbnailStream = await _fileManagerService.GetThumbnail(args);
if (thumbnailStream != null)
{
args.FileStream = thumbnailStream;
}
}
But if I put a breakpoint inside of this method, it gets stuck in a seemingly infinite loop there, and the application freezes.
Is it possible that the bug fix was not included in this release? Or is it possible that the bug can still be triggered in some other way (which I'm unlucky to experience)?
Regards,
Prasanth Madhaiyan.
I can confirm that the problem do not exist in version 29.1.41
Regards,
Prasanth Madhaiyan.