Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Zipstream Php

Zipstream Php Laravel Package

maennchen/zipstream-php

ZipStream-PHP streams ZIP archives directly to the browser or any PSR-7 stream without writing to disk, quickly creating downloads from files, paths, or S3 buckets. Simple named arguments and a single finish call.

View on GitHub
Deep Wiki
Context7

:floppy_disk: PHP ZIP Streaming Library

Frequently asked questions about Zipstream Php
How do I install ZipStream-PHP in a Laravel application?
Install it with composer require maennchen/zipstream-php. There is no service provider, config file, migration, or published asset to register. You can use ZipStream\ZipStream directly in controllers, jobs, or Artisan commands.
Does ZipStream-PHP support Laravel 10, 11, and 12?
ZipStream-PHP is framework-agnostic and fits Laravel 10, 11, and 12 on PHP 8.2 or 8.3. Since version 3.1.2 it requires PHP 8.2 or newer and a 64-bit platform. Assert the PHP version and 64-bit requirement in CI so production does not discover it.
How do I stream a ZIP download from a Laravel controller without writing to disk?
Create a ZipStream\ZipStream instance with outputName and sendHttpHeaders set to false, add files from data, paths, or PSR-7 streams, and call finish inside a Laravel streamed response. Laravel then owns the response headers and streams bytes to the client. This avoids temp files and keeps memory flat under concurrency, though client disconnects can still waste a worker or leave a partial download.
Should I enable sendHttpHeaders in ZipStream-PHP when using Laravel?
Set sendHttpHeaders to false in Laravel. When true, ZipStream-PHP calls PHP's header() directly, which can collide with Laravel and Symfony response middleware, CORS, ETag layers, and other header handling. Let Laravel's response object own the headers.
Can ZipStream-PHP add files from S3 or Laravel Flysystem disks?
Yes. ZipStream-PHP accepts PSR-7 streams, so it composes with Flysystem 3 and Laravel's S3 adapter; open the remote file as a stream and add it to the archive. Version 3.2.0 also added CallbackStreamWrapper::open() for custom sinks, which helps when you need to fan out to S3 and a local copy.
How does ZipStream-PHP handle archives larger than 4 GB or with many files?
ZipStream-PHP v3.1.0 stopped enabling Zip64 unless it is actually required, and v3.2.2 fixed corrupted directory local-header size fields past the 4 GB offset. Test archives that cross 4 GB total size or 65,535 entries explicitly. The recent large-archive fix deserves regression coverage rather than inherited trust.
Will ZipStream-PHP archives open in Excel, macOS Archive Utility, 7-Zip, and Windows Explorer?
Since 3.0, ZipStream-PHP defaults to zero headers with data descriptors, so file sizes are written in trailing descriptors. Modern unzip clients are generally fine, but test the exact clients you must support, including legacy enterprise tools, Excel, macOS Archive Utility, 7-Zip, and Windows Explorer. Confirm compatibility before promising it to partners.
Does ZipStream-PHP support ZIP encryption, resumable downloads, or per-file progress telemetry?
No. ZipStream-PHP is a single-purpose streaming ZIP writer; encryption, resumable downloads, and per-file progress telemetry are outside its scope. Those requirements imply adjacent components or application-level design. Also define your tolerated failure mode for mid-stream client disconnects, such as a wasted worker or partial file.
Is ZipStream-PHP actively maintained, and what are the alternatives?
It is maintained under the MIT license with OpenSSF Best Practices and Scorecard badges, coverage reporting, and a published version-support table. Maintainer concentration is effectively one primary maintainer plus contributors, so treat it as a bus-factor item rather than a non-issue. Alternatives include ext-zip with temporary files or other ZIP libraries, but they do not remove the temp-file tier the same way.
How should I test ZipStream-PHP downloads in Laravel?
Feature-test Laravel endpoints by asserting the streamed response status, headers, and Content-Disposition, then unzip the response body with ZipArchive or inspect the bytes. Cover sendHttpHeaders false, S3/PSR-7 inputs, and at least one large or Zip64 case. Run the suite on a 64-bit PHP 8.2+ CI runner to match production.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log