This article explains how to upload a file to a server in ASP.NET MVC 4.
IntroductionThis article explains how to upload a file to a server in ASP.NET MVC 4.Step 1: Create New ProjectGo to "File" -> "New" -> "Project..." then select "ASP.NET MVC4 Web Application" then enter Application Name then click "OK" then select "Internet Application" then select "View Engine Razor" then click "OK".Step 2: Add a new controller
Go to Solution Explorer then right-click on the Controllers folder from Solution Explorer then seelct "Add" > "Controller" then enter the Controller name then select the Templete "Empty MVC Controller".
Step 3: Add new action into your controller for uploading fileHere I added a "file” action for the file uploading. You can access the posted file directly through the HttpPostedFilesBase object due to model binding.
After uploading the file you can see your file in your project directory location ~/Content/files.
ASP.NET MVC 5 Recipes: A Practical Solution