Save File at C#

public Boolean SaveFile(HttpPostedFileBase file, String name) { Boolean response = false; try { var path = Path.Combine(HttpContext.Current.Server.MapPath("~/Folder"), name); file.SaveAs(path); response = true; } catch (Exception e) { Console.Write(e.Message); } return response; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.