How do I save file on form submit

Kuler Master 326 Reputation points
2024-12-27T16:34:04.0766667+00:00

Hello,

As mentioned in the title, I want to save the file to the server. In the past, we were using SaveAs but in Blazor I can't get a reference of PostedFile directly.

 <div class="row pb-3">
     <div class="col">
         <label class="form-label mb-0">@_localizer["Label_Id"]</label>
         <InputFile class="form-control" id="Id" @bind-Value="@application.FileId" />         
        <ValidationMessage For="@(() => application.FileId)" />      
    </div>
</div>

Thanks in advance

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,706 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,635 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,550 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 68,716 Reputation points
    2024-12-27T17:04:25.5666667+00:00

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.