From 0251dbf5c7e413f1d57efcedfa9a2d6bb989ed27 Mon Sep 17 00:00:00 2001 From: Michel Bardelmeijer Date: Mon, 6 Sep 2021 20:28:28 +0200 Subject: [PATCH] Remove ftruncate for saveAsStream --- src/ZipFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ZipFile.php b/src/ZipFile.php index f976f57..2083e3a 100644 --- a/src/ZipFile.php +++ b/src/ZipFile.php @@ -1537,7 +1537,7 @@ class ZipFile implements \Countable, \ArrayAccess, \Iterator if (!\is_resource($handle)) { throw new InvalidArgumentException('handle is not resource'); } - ftruncate($handle, 0); + $this->writeZipToStream($handle); fclose($handle);