Code C# – Upload file to web server

  public class HttpUploadHelper { private HttpUploadHelper() { } public static string Upload(string url, UploadFile[] files, NameValueCollection form) { HttpWebResponse resp = Upload((HttpWebRequest)WebRequest.Create(url), files, form); using (Stream s = resp.GetResponseStream()) using (StreamReader sr = new StreamReader(s)) { return sr.ReadToEnd(); } } public static HttpWebResponse Upload(HttpWebRequest req, UploadFile[] files, NameValueCollection form) { List<MimePart> mimeParts = new …
Đọc tiếp Code C# – Upload file to web server