hunostor icon

Image upload to server directory with post method

hunostor | PRO | 11/23/18 06:58:25 AM UTC | 0 ⭐ | 360 👁️ | Never ⏰ | []
C# |

460 B

|

None

|

0 👍

/

0 👎

// very good sample https://github.com/jitendraselvam/ImageUpload/tree/master/ImageUploader
// put in the controller
        [HttpPost]
        public ActionResult Index(HttpPostedFileBase kep)
        {
            if(kep != null)
            {
                string content = Server.MapPath("/Content");
                kep.SaveAs(System.IO.Path.Combine(content, "kep.jpg"));
            }        
 
            return RedirectToAction("Index");
        }

Comments