Created
March 18, 2018 20:11
-
-
Save kubawich/e15c9e77550e80c6e2c1e2cef702704e to your computer and use it in GitHub Desktop.
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 (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