static void Main() { var testConnection = new FtpConnection("SERVER", "USER", "PASSWORD"); var testFileLocation = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "/testFile.txt"; var testByteArray = File.ReadAllBytes(testFileLocation); testConnection.UploadFile(testByteArray, "testName", "/SOMEPATH"); }
static void Upload(string [] Input) { if (!Client.IsConnected) { Console.WriteLine("Please connect to a server first."); return; } string SaveFile; if (Input == null) { Console.WriteLine("Invalid parameters"); return; } if (Input.Length > 1) { Input[0] = string.Join(" ", Input); } Console.Write("Save on server as: "); SaveFile = Console.ReadLine(); Client.UploadFile(Input[0], SaveFile, FtpConnection.StreamModes.Binary); }