I have one post method in which one file upload control is there. To get that uploaded file in controller, I am getting error like below :
Error CS1061 'HttpRequest' does not contain a definition for 'Files' and no extension method 'Files' accepting a first argument of type 'HttpRequest' could be found (are you missing a using directive or an assembly reference?)
My code is like below :
[ValidateAntiForgeryToken]
[HttpPost]
public async Task<IActionResult> TeamUserDetail(TeamUsers model)
{
var file = Request.Files[0];
return View();
}
At Request.Files[0] it is giving error shown above. MVC6 is used in project.
Please guide me for it. Am I missing any reference to add?
Thank You