Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.Net.ServicePointManager.Expect100Continue = false;
- using (WebClient wc = new WebClient())
- {
- wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
- wc.UploadFileCompleted += new UploadFileCompletedEventHandler (UploadFileCallback);
- wc.UploadFileAsync(new System.Uri(path), "POST", filePath);
- }
- private void UploadFileCallback(System.Object sender, UploadFileCompletedEventArgs e)
- {
- if (e.Error != null)
- print("error");
- else
- print("success");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement