当前位置 : 主页 > 网页制作 > html >

httpPostedFile实现WEBAPI文件上传

来源:互联网 收集:自由互联 发布时间:2021-06-12
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 " )); } }
        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"));
            }
        }
网友评论