Urgen
Urgen

Reputation: 1223

Syncfusion UploadChangeEventArgs

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); 
        }
    }

Upvotes: 0

Views: 104

Answers (1)

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:

Upvotes: 0

Related Questions