Hi.
After Upgrade to 23.2.6 , FileUploader ValueChange event is not working.When user press to upload system is waiting and after few seconds raising exception.
Exception stack trace :
at Microsoft.AspNetCore.SignalR.ClientProxyExtensions.SendAsync(IClientProxy clientProxy, String method, Object arg1, Object arg2, Object arg3, CancellationToken cancellationToken)
Hi iftixar hamidov,
Greeting from Syncfusion support!
Thank you for bringing the FileUploader ValueChange event issue to our attention. We understand the importance of a seamless experience with our components, and we apologize for any inconvenience this may have caused.
Upon reviewing your concern, we attempted to replicate the issue on our end, but unfortunately, we were unable to do so. In order to better assist you, could you please provide more details about the scenario in which you are facing the problem? Additionally, we have attached a sample for your reference. If possible, kindly modify the provided sample to replicate your specific issue.
Moreover, including the steps to replicate the problem and any other relevant information will greatly aid us in identifying the root cause and providing you with a prompt and accurate solution.
We appreciate your understanding and cooperation in resolving this matter. Please don't hesitate to get back to us with the requested details.
Regards,
Kokila Poovendran.
First of all, thank you for your answer.
Interestingly, I created another new Blazor server project and I am trying the latest version of Syncfusion there. It works. But it does not work in my project. There are too many references and API usage in the project. If it were not like this, I would send you the project. Is there a chance to connect remotely via Anydesk and provide support?
Hi iftixar hamidov,
It's great to hear that the latest version of Syncfusion is working in a new Blazor server project. We understand the challenges you're facing with your existing project, and we're here to assist you.
Before we proceed with remote support via AnyDesk, could you please share the complete runnable sample of your project with us? This will allow us to examine the specific details and provide you with a more accurate and efficient solution.
Once we have your sample, we'll thoroughly investigate the issue and offer the best possible assistance. Your cooperation is highly appreciated, and we look forward to resolving this matter promptly.
Thank you for your understanding.
Regards,
Kokila Poovendran.
Thank you for your answer. I can share the source. But it will be a problem to run it. Because without the database, you will not even be able to log in to the program. The database volume is also very large. Unfortunately, it is impossible for me to share it. However, if you want, would you like me to send the source?
Hi iftixar hamidov,
Thank you for your prompt response, and we appreciate your willingness to provide further information. We understand the constraints related to sharing the entire source, especially considering the large database volume.
To proceed with troubleshooting the issue you're experiencing with the File Uploader component, we kindly request you to share the razor page code where you are rendering the File Uploader component. Additionally, including the relevant code snippet from the controller end will greatly assist us in diagnosing and providing an effective solution.
Regards,
Kokila Poovendran.
Thank you for your constructive approach. In the attached file, you can find the razor and the code for the razor in the folder named GroupPolicies. Additionally, I am sending the Program.cs file. This code is currently working. However, the same code does not work when I upgrade the version of the Syncfusion components. Thank you.
I am sending the frontend project as attachment. This problem occurs even before going to the API.
Hi iftixar hamidov,
We sincerely apologize for the inconvenience caused by the issue you're encountering with the Syncfusion components after upgrading the version. Thank you for providing the code and attachments for further analysis.
After reviewing the provided materials, we attempted to replicate the issue using the latest version of Syncfusion components. However, we couldn't reproduce the problem on our end. To assist you more effectively, we've created a sample application and prepared a video illustration showcasing the functionality.
Please find the attached sample application and watch the video illustration for reference. In the sample, we've incorporated a Dialog component containing a Card component, which encapsulates the Uploader component. We observed that the change event was triggered properly during file upload.
To expedite the resolution process, we kindly request you to replicate the issue in the provided sample application. This will enable us to pinpoint the problem accurately and offer you the appropriate solution.
Thank you for your cooperation and understanding. We're committed to resolving this issue promptly and ensuring the smooth functioning of your application.
Thank you for your answer. I will make a detailed video for both versions and add it here. I cannot solve the problem.
Hi iftixar hamidov,
We will wait to hear from you.
Regards,
Shereen
Hi.Now i'm creating videos for both versions in same app.I will upload today
Hi again.This video contains porocess with old 20.4.0.54 version.Everthink is working,ok.No problem.
You can download this video from this link : https://drive.google.com/file/d/1kuKAHg0Id-cEJaI0tPYHFo2GY-EZvxY8/view?usp=sharing
The second video is with new last version (25_1_35) of blazor components in same project.You can download this video from here : https://drive.google.com/file/d/11nUE3-PQEmB3Uvj5YxW36-A-KN8GsV1c/view?usp=sharing
Thnak you
Hi iftixar hamidov,
Thank you for providing the video illustrations demonstrating the behavior differences between the old version (20.4.0.54) and the new version (25.1.35) of the Blazor components in your project.
Upon reviewing the videos, we understand that there is a difference in the behavior of the Blazor components, specifically related to the uploader component, between the two versions. We appreciate your efforts in sharing these details with us.
To further investigate and address the issue, could you please confirm whether you are using the uploader component inside a grid component in your project? This information will help us better understand the context in which the uploader component is being used and assist us in providing a suitable solution.
Thank you for your understanding and cooperation. We're here to help resolve any issues you're experiencing with the Syncfusion Blazor components.
Hi Kokila Poovendran,
No ,not in grid.First i have a render fragment.
public RenderFragment SelectFileFragment => __builder => {
<SfUploader @ref="uploader" AutoUpload="false" AllowedExtensions=".xls, .xlsx" AllowMultiple="false" SequentialUpload="true">
<UploaderEvents ValueChange="UploaderOnChange"></UploaderEvents>
</SfUploader>
};
Then i use inside SfDialog component as below.
<SfDialog Width="90%" Header="@DialogHeader" ShowCloseIcon="true" IsModal="true" EnableResize="true"
ResizeHandles="@(new ResizeDirection[] { ResizeDirection.All })" @bind-Visible="@DialogVisibility">
<DialogTemplates>
<Content>
<div class="dialogContent">
<SfCard>
<CardContent EnableSeparator="true">
if ( DialogType == (int)DialogTypes.SelectFile ) {
<div class="dialogContent">
@SelectFileFragment
</div>
}
</CardContent>
</SfCard>
</div>
</Content>
</DialogTemplates>
<DialogButtons>
<DialogButton Content="@AppResource["Close"]" OnClick="@(()=>CLoseDailog(false))" />
</DialogButtons>
</SfDialog>
But i want to say that i have usage of uploader directly inside of razor file also.The same problem happens.
Thank you.
Hi iftixar hamidov,
Thank you for your patience. It appears that the issue you're encountering might be related to changes introduced in version "21.1.35" of our uploader component, which includes breaking changes affecting the uploader change event. We recommend reviewing the release notes for more detailed information on these changes: https://blazor.syncfusion.com/documentation/release-notes/21.1.35?type=all#breaking-changes-7
Upon further examination of your code snippet, it seems that the problem could be stemming from the code handling the value change event. Specifically, it appears that you're using outdated code for the fileStream, which could be causing the issue.
We suggest updating your code according to the following snippet:
private async Task UploaderOnChange(UploadChangeEventArgs args) {
//https://www.syncfusion.com/forums/185791/after-upgrade-to-23-2-6-valuechange-problem
bool success = false;
try {
await base.OperationStarts();
#region save File string rootPath = configuration["InsureazSettings:UploadedFilesFolder"];
string fullPath = "";
foreach ( var file in args.Files ) {
fullPath = rootPath + file.FileInfo.Name;
if ( System.IO.File.Exists(fullPath) ) { System.IO.File.Delete(fullPath); }
FileStream filestream = new FileStream(fullPath, FileMode.Create, FileAccess.Write); // Calls the OpenReadStream method on the uploaded file to get a read stream await file.File.OpenReadStream(long.MaxValue).CopyToAsync(filestream); filestream.Close();
} uploader?.ClearAllAsync(); } |
Please implement these changes in your sample code and test again. If you have any further questions or encounter any issues, please don't hesitate to reach out to us for further assistance.
Documentation: https://blazor.syncfusion.com/documentation/file-upload/async#with-server-side-api-endpoint
I think the problem is not related to this. Because it never comes to that method. It fails before it gets there. I even increased the .net8 version. I updated all the packages. But the result is the same. I am sending video as attachment.
Viewo link : https://drive.google.com/file/d/1HottV54AfTbwO9To7lFIUZR-5uhGgXEC/view?usp=sharing
Hi Iftixar,
We have create a ticket for your query, please follow-up the ticket for further updates.
Regards,
Shereen
Hi.Thank you for response.From where i can follow? Please inform.Thank you.
Hi Iftixar,
Please check your mail for the ticket follow-up.
Regards,
Shereen
Hello again. I have solved the cause of the problem.You can download the sample project from the link below.
https://drive.google.com/file/d/1ndfUcxcakW6edCzhgXS0igMBexe49MBD/view?usp=sharing
The problem occurs when dependency injection occurs in the Autofac class.
The same problem occurs when I use this code.
#region This part creates a problem
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureContainer<ContainerBuilder>(builder => {
//builder.RegisterModule(new ClaimDependencies());
builder.RegisterModule(new CoreSystemDependencies());
//builder.RegisterModule(new SaleDependencies());
//builder.RegisterModule(new CrmDependencies());
});
#endregion
However, when I inject dependency directly in program.cs in this way, the problem does not occur.
#region The problem occurs when you comment this section and open the section above.
builder.Services.AddSingleton<HttpClient>();
builder.Services.AddSingleton(typeof(IHttpClientCalls),typeof(HttpClientCalls));
builder.Services.AddSingleton(typeof(IAuthenticationSvc),typeof(AuthenticationSvc));
builder.Services.AddScoped<StateProvider>();
builder.Services.AddSingleton(typeof(ISyncfusionStringLocalizer),typeof(SyncfusionLocalizer));
#endregion
Hi Iftixar,
Thank you for the update. Please get back to us for assistance in the future.
Regards,
Shereen