Skip to content

Commit

Permalink
fix zipper
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jan 22, 2024
1 parent a9e225a commit 4759fd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/MediaZipper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ public function getZipStream(array $options = [])
);

/** @var Media $item */
foreach ($this->media as $item) {
foreach ($this->media as $index => $item) {
$stream = $item->readStream();

$zip->addFileFromStream(
fileName: $item->file_name,
stream: $stream
fileName: "{$index}_{$item->file_name}",
stream: $stream,
exactSize: $item->size,
);

if (is_resource($stream)) {
Expand Down

0 comments on commit 4759fd7

Please sign in to comment.