Skip to content

Instantly share code, notes, and snippets.

@kubawich
Created March 18, 2018 20:11
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 kubawich/e15c9e77550e80c6e2c1e2cef702704e to your computer and use it in GitHub Desktop.
Save kubawich/e15c9e77550e80c6e2c1e2cef702704e to your computer and use it in GitHub Desktop.
using (SftpClient client = new SftpClient(serwer, port, user, pass))
{
client.Connect();
client.ChangeDirectory("/var/www/html/img");
using (FileStream fs = new FileStream(Path.GetFileName(Upload.FileName), FileMode.Create))
{
client.BufferSize = 4 * 1024;
client.UploadFile(fs, Path.GetFileName(Upload.FileName));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment