Last active
February 25, 2022 09:15
-
-
Save Zalexanninev15/13df3d870ee9951b65081212cde9863a to your computer and use it in GitHub Desktop.
FileUploader Demo (for VitNX2)
This file contains 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.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