IFormFile file = Request.Form.Files[0]; string folderName = "UploadExcel"; string webRootPath = _hostingEnvironment.WebRootPath; string newPath = Path.Combine(webRootPath, folderName); StringBuilder sb = new StringBuilder(); if (!Directory.Exists(newPath)) { //Directory.CreateDirectory(newPath); } if (file.Length > 0) { using var ms = new MemoryStream(); file.CopyTo(ms); var Orderz = GetExcelContent(ms); model.Neworder = Orderz; } return View("Create", model);
RedirectToAction
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)