Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to upload and read an excel file (.xlsx) in a blazor server project

$
0
0

I have a blazor server project and I need to send an excel file with data to create objects of an entity. I have searched a lot and have not found anything that has worked for me. I believe my problem is accessing the file to then be able to do what I want.

In my blazor component i have:

<InputFile OnChange="@ImportExcelFile" accept=".xlsx" multiple="false"></InputFile>@code {    async Task ImportExcelFile(InputFileChangeEventArgs e)    {        await EnrollmentService.CreateEnrollmentByExcel(e);    }}

In my EnrollmentService.cs i need to read file.

If anyone can help me I would be very grateful.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>