(Preface: this question is about ASP.NET MVC 3.0 which was released in 2011, it is not about ASP.NET Core 3.0 which was released in 2019)
I want to upload file in asp.net mvc. How can I upload the file using html input file
control?
asp.net-mvcasp.net-mvc-3c++
(Preface: this question is about ASP.NET MVC 3.0 which was released in 2011, it is not about ASP.NET Core 3.0 which was released in 2019)
I want to upload file in asp.net mvc. How can I upload the file using html input file
control?
Best Answer
You don't use a file input control. Server side controls are not used in ASP.NET MVC. Checkout the following blog post which illustrates how to achieve this in ASP.NET MVC.
So you would start by creating an HTML form which would contain a file input:
and then you would have a controller to handle the upload: