Merge pull request #12287 from nextcloud/bug/allow_writing_empty_file

Allow writing an empty file with the new writeStream
This commit is contained in:
Morris Jobke 2018-11-05 18:12:28 +01:00 committed by GitHub
commit 6635bd6399
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {