Description
Laravel ZipStream is a package for Laravel that builds zip files on the fly and streams them to the user. The zip download begins immediately, even while the archive is still being created, so you do not need to save the zip to disk first. The package builds zips from local files, from S3 or other storage, or from any PSR-7 stream. It calculates the zip's size up front, so the Content-Length header is set and the browser can estimate the download time. The size can only be calculated for HTTP sources that send a Content-Length header. The package is built on the ZipStream-PHP library. A controller calls the create method on the Zip facade, which returns a StreamedResponse, and the service provider and facade are wired up automatically. You can set the path of each file inside the zip, create subfolders, add files one at a time with a fluent interface, add raw data, and add files from a storage disk with addFromDisk. The README points to upgrade notes for version 5, which has breaking changes.…
Highlights
- Streams zip downloads as they are built
- Sets Content-Length up front
- Files from local disk, S3 or PSR-7 streams
- Subfolders and custom paths inside the zip
- Raw data and storage disk sources
Ratings & Reviews
No ratings yet
Be the first to rate Laravel Zipstream.
People also visit
Laravel Zipstream FAQ
What does Laravel ZipStream do?
It builds zip files on the fly and streams the download, so the browser starts before the zip is finished.
Does it save the zip to disk?
No. The README says the zip is created without saving it to disk first.
Can it set the file size?
Yes. It calculates the zip size up front for the Content-Length header when the sources allow it.
Can I add files from S3 or a disk?
Yes. It supports local or S3 files and files from a storage disk with addFromDisk.
Is there an upgrade path?
The README links upgrade notes for version 5, which includes breaking changes from version 4.
What are the best Laravel Zipstream alternatives?
Popular alternatives to Laravel Zipstream include Zipfly, Stream Parser and Smart Open. See all Laravel Zipstream alternatives



