mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
fixed #1672: Truncate file when overwriting
This commit is contained in:
parent
300f57f5ba
commit
15e1608e71
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue