1 foreach (var file in Request.Files) 2 { 3 var pathSrc = System.Web.HttpContext.Current.Server.MapPath("~/Upload/" + dt + "." + file.Name.Split('.')[1]); 4 using (FileStream fs = new FileStream(pathSrc, FileMode.Create)) 5 { 6 file.Value.CopyTo(fs); 7 } 8 9 return Response.AsJson(new { img = "http://" + Request.Url.HostName + "/Upload/" + dt + "." + file.Name.Split('.')[1] }); 10 }