How to Upload/ Download Files In ASP.NET Core

Problem How to upload and download files in ASP.NET Core MVC. Solution In an empty project, update the Startup class to add services and middleware for MVC. public void ConfigureServices(           IServiceCollection services)       {           services.AddSingleton<IFileProvider>(               new PhysicalFileProvider(                   Path.Combine(Directory.GetCurrentDirectory(), “wwwroot”)));              services.AddMvc();       }          public void Configure(           IApplicationBuilder app,           IHostingEnvironment env)       {           app.UseMvc(routes =>  … Continue Reading