sftp: open files for update write only to fix AWS SFTP interop - fixes #3776

This commit is contained in:
Nick Craig-Wood 2019-12-02 17:28:50 +00:00
parent ef7ac088c0
commit db39adeb3e
1 changed files with 1 additions and 1 deletions

View File

@ -1215,7 +1215,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
if err != nil {
return errors.Wrap(err, "Update")
}
file, err := c.sftpClient.Create(o.path())
file, err := c.sftpClient.OpenFile(o.path(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC)
o.fs.putSftpConnection(&c, err)
if err != nil {
return errors.Wrap(err, "Update Create failed")