how to read file name from file upload

dir sir,

how can i read the file name from file uplaod  and put it another value 

private void OnChange(UploadChangeEventArgs args)

    {

      string  VideosName;

        foreach (var file in args.Files)

        {

            

             VideosName = file.FileInfo.Name;

          

        }

    }


1 Reply

UD UdhayaKumar Duraisamy Syncfusion Team November 14, 2022 05:25 AM UTC

You can get the selected file name in the FileSelected event. The FileSelected event triggers after selecting or dropping the files by adding the files in upload queue.


@using Syncfusion.Blazor.Inputs

 

<SfUploader>

    <UploaderEvents FileSelected="@FileSelectedHandler"></UploaderEvents>

</SfUploader>

 

@code {

    private void FileSelectedHandler(SelectedEventArgs args)

    {

        var Selected_FileName = args.FilesData[0].Name;

    }

}


Documentation : https://blazor.syncfusion.com/documentation/file-upload/events#fileselected


Loader.
Up arrow icon