Skip to content

Instantly share code, notes, and snippets.

@dmorrison
Last active December 23, 2015 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmorrison/6670807 to your computer and use it in GitHub Desktop.
Save dmorrison/6670807 to your computer and use it in GitHub Desktop.
.NET file upload example (in C#)
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