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"));
            }
        }

猜你喜欢

转载自www.cnblogs.com/superfeeling/p/11544224.html