Last active
December 23, 2015 17:39
-
-
Save dmorrison/6670807 to your computer and use it in GitHub Desktop.
.NET file upload example (in C#)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net; | |
public static class FileUploader | |
{ | |
public static void Main() | |
{ | |
const string address = "(enter address to post to here)"; | |
const string fileName = "C:\\Full\\Path\\To\\File.csv" | |
// Upload the file to the URI. UploadFile() implicitly | |
// uses the HTTP POST method. | |
var webClient = new WebClient(); | |
webClient.UploadFile(address, fileName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment