From 665a6d205519786c5e8415ca720c33adfcfc8bcd Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 5 Nov 2018 17:00:04 +0100 Subject: Allow writing an empty file with the new writeStream Signed-off-by: Roeland Jago Douma --- apps/dav/lib/Connector/Sabre/File.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/dav/lib/Connector/Sabre/File.php') diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 57c072fda47..fc30393bb46 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -167,6 +167,10 @@ class File extends Node implements IFile { if ($partStorage->instanceOfStorage(Storage\IWriteStreamStorage::class)) { $count = $partStorage->writeStream($internalPartPath, $data); $result = $count > 0; + if ($result === false) { + $result = feof($data); + } + } else { $target = $partStorage->fopen($internalPartPath, 'wb'); if ($target === false) { -- cgit v1.2.3