summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/sftp.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index bcc4c5eafd5..95e0cefa398 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -285,6 +285,9 @@ class SFTP extends \OC\Files\Storage\Common {
public function rename($source, $target) {
try {
+ if (!$this->is_dir($target) && $this->file_exists($target)) {
+ $this->unlink($target);
+ }
return $this->client->rename(
$this->absPath($source),
$this->absPath($target)