httpPostedFile实现WEBAPI文件上传

        public void PostUpload()
        {
            var httpPostedFile = HttpContext.Current.Request.Files;
            foreach(string p in httpPostedFile)
            {
                var file = httpPostedFile[p];
                file.SaveAs(HttpContext.Current.Server.MapPath("/test.jpg"));
            }
        }

 

posted on 2019-09-18 18:06  静以修身俭以养德  阅读(869)  评论(0编辑  收藏  举报

导航