fixed #1672: Truncate file when overwriting

This commit is contained in:
Jaex 2016-06-28 18:40:45 +03:00
parent 300f57f5ba
commit 15e1608e71

View file

@ -231,7 +231,7 @@ private bool UploadStream(Stream stream, string remotePath)
{
try
{
using (SftpFileStream sftpStream = client.OpenWrite(remotePath))
using (SftpFileStream sftpStream = client.Create(remotePath))
{
return TransferData(stream, sftpStream);
}
@ -242,7 +242,7 @@ private bool UploadStream(Stream stream, string remotePath)
CreateDirectory(URLHelpers.GetDirectoryPath(remotePath));
using (SftpFileStream sftpStream = client.OpenWrite(remotePath))
using (SftpFileStream sftpStream = client.Create(remotePath))
{
return TransferData(stream, sftpStream);
}