Skip to content

Commit

Permalink
Copy stream data in chunks.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 14, 2017
1 parent 57c4fd7 commit 6fbdc72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion framework/Vfs/lib/Horde/Vfs/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,9 @@ protected function _ensureSeekable($stream)
$meta = stream_get_meta_data($stream);
if (!$meta['seekable']) {
$temp = @fopen('php://temp', 'r+');
stream_copy_to_stream($stream, $temp);
while (!feof($stream)) {
fwrite($temp, fread($stream, 8192));
}
return $temp;
}

Expand Down

0 comments on commit 6fbdc72

Please sign in to comment.