Syncfusion UploadChangeEventArgs

68 Views Asked by At

I tried to get the FilePath dynamically on user's selection. Syncfusion documentation says that var path = file.FileInfo.FileSource gets the filepath selected by browser, however it returns null.

What is the way to get the file path dynamically not hardcoded. I am able to get the filepath with hardcoded but I don't want this way.

private async Task OnChange(UploadChangeEventArgs args)
    {
        var fileProcess = new LoadExcelData(Logger, Configuration);

        // var filePath = @"C:\Users\xxx\Desktop\DataServices\";
        foreach (var file in args.Files)
        {
            var path = file.FileInfo.FileSource;
            await fileProcess.ProcessExcelFiles(path, UpdateProgressBar); 
        }
    }
1

There are 1 best solutions below

0
On

You cannot retrieve the selected file path on both the client side and server side due to security reasons. Please refer to the following common links for more information: