We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description With symfony this would a pretty easy way to stream large zip files on the fly:
$finder = new Finder(); $finder ->files() ->in('path'); $zipFile = new ZipFile(); $zipFile->addFromFinder($finder, $options = [ ZipOptions::COMPRESSION_METHOD => ZipCompressionMethod::DEFLATED, ]); $response = new StreamedResponse(function() use ($zipFile) { $outputStream = fopen('php://output', 'wb'); $zipFile->saveAsStream($outputStream); }); $response->headers->set('Content-Type', 'application/zip'); $disposition = HeaderUtils::makeDisposition( HeaderUtils::DISPOSITION_ATTACHMENT, 'file.zip' ); $response->headers->set('Content-Disposition', $disposition); return $response;
But the problem is the saveAsStream() only works with seekable streams. (btw you should check stream_get_meta_data of $handle in saveAsStream method)
Is there any workaround to save large zip into a non-seekable stream?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
With symfony this would a pretty easy way to stream large zip files on the fly:
But the problem is the saveAsStream() only works with seekable streams. (btw you should check stream_get_meta_data of $handle in saveAsStream method)
Is there any workaround to save large zip into a non-seekable stream?
The text was updated successfully, but these errors were encountered: