I'm posting a simple text file to an asp.net MVC app. When I post using the form below, the form parameter is not null. But file is. Any ideas what I'm doing wrong?
<form method=post action="http://localhost/Home/ProcessIt" enctype="application/x-www-form-urlencoded"> <input type=file id="thefile" name="thefile" /> <input type="submit" name="Submit" /> </form> In the asp.net mvc app:
[HttpPost] public ActionResult ProcessIt(FormCollection thefile) { HttpPostedFileBase file = Request.Files["thefile"]; ... }