-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
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
Question: How to add a stream resource? #79
Comments
Are you able to get the size of this particular stream? Curious if you are able to If you can get size, I don't see why it can't work with the package. It would likely need a new file model that expects a stream. Would be a nice addition to the package, I'm just not sure if all Flysystem sources would provide stream size. |
Ah good point. I did try implementing a new model, and got it working with local streams, but some of them are going to be remote so it won't be possible to get their size with I guess that means this package wouldn't really be suitable for this use case and I should use php-zipstream instead? |
I think so. I wrote this zipstream wrapper package to be pretty opinionated. I wanted size calculations up front so that I could send a So yeah, if you're not looking to do things this way, might be easiest to use the lower-level package directly. |
Sure makes sense. Thanks for you help! 😊 |
Thanks for this awesome library!
Just a quick question: How do you add a stream resource directly?
When I try
$zip->add($stream, $basename)
I get:With the underlying php-zipstream you use
addFileFromStream()
, but I can't figure out how to do it with laravel-zipstream. I think the readme suggests this is possible so I'm probably just missing something! 😄For context I'm trying to add streams from Flysystem's
readStream()
method: https://flysystem.thephpleague.com/docs/usage/filesystem-api/ . The files could come from any of the sources Flysystem supports so I can't use paths, and I dont want to read the files first to keep memory usage down.The text was updated successfully, but these errors were encountered: