SfUploader - adding second browsed file doesn't upload first

Hi,

Not sure if I am doing something wrong. In the SfUploader component:

  1. Click on Browse to select a file, or drag/drop file into file area.
  2. Click on Browse again to select second file, or drag/drop second file.
  3. Click on Upload
  4. Only second file is uploaded. First file displays status "File type is not allowed"
  5. But, if both files are selected together in single Browse click, both are uploaded successfully.


@page "/upload"

<p>Syncfusion SfUploader</p>
<div>
    <SfUploader AllowMultiple=true AllowedExtensions=".jpg, .png, .bmp, .ico"
        AutoUpload=false>
        <UploaderEvents ValueChange="@OnChange"></UploaderEvents>
    </SfUploader>
</div>

@code {

    private async Task OnChange(UploadChangeEventArgs args)
    {
        try
        {
            foreach (var file in args.Files)
            {
                var path = @"wwwroot\media\" + file.FileInfo.Name;
                FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write);
                await file.File.OpenReadStream(long.MaxValue).CopyToAsync(filestream);
                filestream.Close();
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
}

Image_7019_1694379190640

Image_1080_1694379242514


When both selected together in a single Browse click:

Image_3344_1694380293067



3 Replies 1 reply marked as answer

KP Kokila Poovendran Syncfusion Team September 12, 2023 09:50 AM UTC

Hi Shiv,


Greeting from Syncfusion support!


This is a breaking changes in our end from 21.1.35 version. When attempting to upload multiple files by selecting them individually and clicking the upload button, only the last file appears to successfully upload and saved. This issue occurs when the "AutoUpload" property is set to false. If you wish to select multiple files one by one, you must upload each file before selecting the next one.


Regards,

Kokila Poovendran.


Marked as answer

SH Shiv replied to Kokila Poovendran September 12, 2023 12:14 PM UTC

Hi Kokila/Syncfusion support,

Thank you for the prompt reply and the suggestion for the time being. Will take this into consideration.


Regards

Shiv



SS Shereen Shajahan Syncfusion Team September 13, 2023 06:25 AM UTC

Hi Shiv,

We are marking this as solved for now. Please reopen this forum or create a new forum for assistance in the future.

Regards,

Shereen


Loader.
Up arrow icon