Skip to content

Instantly share code, notes, and snippets.

@Zalexanninev15
Last active February 25, 2022 09:15
Show Gist options
  • Save Zalexanninev15/13df3d870ee9951b65081212cde9863a to your computer and use it in GitHub Desktop.
Save Zalexanninev15/13df3d870ee9951b65081212cde9863a to your computer and use it in GitHub Desktop.
FileUploader Demo (for VitNX2)
using System.Collections.Specialized;
using System.Text;
using VitNX.Functions.Common.Web;
namespace FileUploader
{
class Demo
{
public static void Upload()
{
var log = new StringBuilder();
SendDataToSites.FileUploader.UploadFile(
url: "http://example.com/upload",
filePath: @"C:/some_file.txt",
values: new NameValueCollection
{
["key1"] = "value1",
["key2"] = "value2"
},
progress: (s,e) => log.AppendLine($"Progress: {s} - {e}"),
completed: (s) => log.AppendLine($"Completed: {s}")
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment