diff -ru src/CurlDownloader.php src/CurlDownloader.php --- src/CurlDownloader.php 2019-04-15 14:25:16.687307074 +0000 +++ src/CurlDownloader.php 2019-04-15 14:25:17.543284269 +0000 @@ -63,12 +63,12 @@ $params = stream_context_get_params($context); $ch = curl_init(); - $hd = fopen('php://temp/maxmemory:32768', 'w+b'); - if ($file && !$fd = @fopen($file.'~', 'w+b')) { + $hd = fopen('php://temp/maxmemory:32768', 'w+'); + if ($file && !$fd = @fopen($file.'~', 'w+')) { $file = null; } if (!$file) { - $fd = @fopen('php://temp/maxmemory:524288', 'w+b'); + $fd = @fopen('php://temp/maxmemory:524288', 'w+'); } $headers = array_diff($params['options']['http']['header'], ['Connection: close']); @@ -167,7 +167,7 @@ } } finally { if ($file && !isset($this->exceptions[(int) $ch])) { - $fd = fopen($file, 'rb'); + $fd = fopen($file, 'r'); } unset($this->jobs[(int) $ch], $this->exceptions[(int) $ch]); curl_multi_remove_handle($this->multiHandle, $ch);