File upload syntax using Blazor Synfussion Control

@using JR_PDFtoExcel.Data;
@inject PdfService PdfService

<PageTitle>Schedule F</PageTitle>

<h1>Schedule F</h1>
<SfUploader AllowMultiple="false" AutoUpload="false" AllowedExtensions=".pdf" >
    <UploaderEvents ValueChange="OnChange" OnClear="ClearMsg"></UploaderEvents>

@if (LoadMsg == "File is loading...")
    <Wave />   

@code {

    public string? LoadMsg { get; set; }

    private async Task<bool> OnChange(UploadChangeEventArgs args)
        foreach (var file in args.Files)
            LoadMsg = "File is loading...";
            var path = "wwwroot/" + file.FileInfo.Name;
            FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write);
            LoadMsg = "File loaded...";
            //  call the function to convert PDF to Excel
           //await PdfService.ExcelScheduleF(ExcelfilePath);
         await Task.Delay(1);
         return true;

     private void ClearMsg()
        LoadMsg = "";


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.