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
close icon

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 12:25 AM

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.
Live Chat Icon For mobile
Up arrow icon