@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>
</SfUploader>
@if (LoadMsg == "File is loading...")
{
<Wave />
}
@LoadMsg
@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);
file.Stream.WriteTo(filestream);
filestream.Close();
file.Stream.Close();
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 = "";
}
}
Like this:
Like Loading...
Related