aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/Storage/SFTP.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/SFTP.php')
-rw-r--r--apps/files_external/lib/Lib/Storage/SFTP.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php
index 5dd11b2fe53..bc25477bcf6 100644
--- a/apps/files_external/lib/Lib/Storage/SFTP.php
+++ b/apps/files_external/lib/Lib/Storage/SFTP.php
@@ -381,11 +381,12 @@ class SFTP extends Common {
switch ($mode) {
case 'r':
case 'rb':
- if (!$this->file_exists($path)) {
+ $stat = $this->stat($path);
+ if (!$stat) {
return false;
}
SFTPReadStream::register();
- $context = stream_context_create(['sftp' => ['session' => $connection]]);
+ $context = stream_context_create(['sftp' => ['session' => $connection, 'size' => $stat['size']]]);
$handle = fopen('sftpread://' . trim($absPath, '/'), 'r', false, $context);
return RetryWrapper::wrap($handle);
case 'w':