diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
index 681e45ad3f2ffd0119eb88b3675cc7ecbf4bdd25..fbfbcfaa409b599b98d38603c5638dd1ae2e736d 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php
@@ -410,10 +410,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
 	}
 
 	public function file_put_contents($path, $data) {
-		$stream = fopen('php://temp', 'r+');
-		fwrite($stream, $data);
-		rewind($stream);
-		return $this->writeStream($path, $stream, strlen($data)) > 0;
+		$handle = $this->fopen($path, 'w+');
+		fwrite($handle, $data);
+		fclose($handle);
+		return true;
 	}
 
 	public function writeStream(string $path, $stream, int $size = null): int {