We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

File Upload Stream Write Error

I have updated Syncfusion Blazor yesterday and I am getting the error: 

Syncfusion.Blazor.Inputs.UploadFiles.Stream.get returned null.


Meanwhile I am using the sample code as below which used to work before the update. I also get UploadFiles.Stream is obsolete:


private void OnChange(Syncfusion.Blazor.Inputs.UploadChangeEventArgs args)

{

foreach (var file in args.Files)

{

fName = file.FileInfo.Name;

if (!Directory.Exists(UploadFolder)) Directory.CreateDirectory(UploadFolder);

fileName = Path.Combine(UploadFolder, fName);

FileStream filestream = new FileStream(fileName, FileMode.Create, FileAccess.Write);

file.Stream.CopyTo(filestream);

filestream.Close();

file.Stream.Close();

}

}


4 Replies

PK Priyanka Karthikeyan Syncfusion Team March 27, 2023 11:05 AM UTC

Hi Michael,

We would like to inform you that there have been breaking changes in the 21.1.35 version onwards for the file stream argument for the Change event. We recommend referring to the release notes for more information on these changes. You can find the release notes on the Syncfusion Blazor documentation page here: https://blazor.syncfusion.com/documentation/release-notes/21.1.35?type=all#breaking-changes-7

We suggest using the updated code provided in the release notes to resolve the issue you are facing

code changes here:


Regards,

Sureshkumar P



MO Michael Ofori-Appiah March 29, 2023 10:19 AM UTC

Thanks, its working fine.



JE Jean March 29, 2023 02:45 PM UTC

Uploader gets stuck when uploading multiple files in a dialog. 



SP Sureshkumar P Syncfusion Team March 31, 2023 03:32 AM UTC

Hi Jean,

Thank you for reaching out to us. In order for us to provide you with an accurate solution, we require more detailed information about your requirement. It would be helpful if you could provide us with any image or video demonstration of the issue you are facing. Additionally, please share the following details:

  1. Have you rendered the uploader component inside the dialog or not?

  2. Is the issue replicated when the component is placed inside the dialog or any other component, or is it a standalone component?

  3. Could you please share your exact Syncfusion package version details?

Once we receive these details, we will be able to provide you with an exact solution in a timely manner.

Regards,

Sureshkumar P


Loader.
Up arrow icon