/FileUploadsInAspNetMvc

How to do file uploads in ASP.NET MVC while posting additional model data

Primary LanguageC#MIT LicenseMIT

File Uploads in ASP.NET MVC with View Models

Working code sample compiled from snippets provided by this tutorial: https://cpratt.co/file-uploads-in-asp-net-mvc-with-view-models/

What concepts are demonstrated?

  • use a single MVC view model to describe an entity including data provided by file uploads
  • provide separate models for domain modelling and presentation purposes
  • MVC model binding - controller actions use complex type parameters
  • MVC model validation - model class uses data annotations