public static Token Upload(string url, byte[] data) { #if DEBUG Debug.Assert(!string.IsNullOrEmpty(url)); Debug.Assert(data != null); #endif var token = GenerateToken(); var worker = WebUploadWorker.Create(); _workers.Add(token, worker); worker.Request(url, data, 0, data.Length); return(token); }
public static Token Upload(string url, string targetFile) { #if DEBUG Debug.Assert(!string.IsNullOrEmpty(url)); Debug.Assert(!string.IsNullOrEmpty(targetFile)); #endif var token = GenerateToken(); var worker = WebUploadWorker.Create(); _workers.Add(token, worker); worker.Request(url, targetFile); return(token); }
public static WebUploadWorker Create() { var worker = new WebUploadWorker(); return(worker); }