Doing File Upload in ASP .Net MVC 3 is easier than ASP .Net Web Form. On this example Only two controller and one view is needed to perform this task.
Controller
public class FileController : Controller { // // GET: /File/
public ActionResult Index() { return View(); } [HttpPost] public ActionResult Upload(HttpPostedFileBase f) { if (f.ContentLength > 0) { string filePath = Path.Combine(HttpContext.Server.MapPath(“\\Uploads\\”), Path.GetFileName(f.FileName)); f.SaveAs(filePath); } return RedirectToAction(“Index”); }
}
Pingback: Carpet, wall drying
Pingback: Bronzeskulpturen
Pingback: Extensions bestellen
Pingback: You Can Find It Here
Pingback: kino.to nachfolger