예제 #1
0
        public ActionResult Upload()
        {
            if (Request.Files.Count > 0)
            {
                var file = Request.Files[0];

                if (file != null && file.ContentLength > 0)
                {
                    Stream fileStream = file.InputStream;
                    var    fileName   = Path.GetFileName(file.FileName);
                    _iSaleService.AddSaleFromFile(fileStream, fileName);
                    //var path = Path.Combine(Server.MapPath("~/Uploads/"), fileName);
                    //file.SaveAs(path);
                }
            }

            return(RedirectToAction("Index"));
        }