Skip to content
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

Allow http streams #66

Open
vendcore opened this issue Oct 14, 2020 · 0 comments
Open

Allow http streams #66

vendcore opened this issue Oct 14, 2020 · 0 comments

Comments

@vendcore
Copy link

I basically need to be able to read ZIP streams from files hosted on an HTTP site. Currently, I can do streams with Guzzle, even if the file doesn't support seeking. You can just buffer the content in RAM, and then "seek" to it.

I understand the trade offs, but I need to read metadata from a file in a ZIP file that is very large, and I only need to open the first file in the archive, look at the first few lines to determine the contents, and then exit. Out of a 5 Gib file, I would probably only need to download the first few megabytes to accomplish this, the ZIP central directory, and then the beginning of the file in the archive, that I need to read the first few lines of.

Looking at your code, for example, reading the central directory, there is no reason why you can just "seek", not the PHP operation, but a "wrapper", for just downloading more bytes of the file, until you have enough to work with.
For zip files, If you need to grab data from a file that is later in the archive, then you are forced to download all of the data until you get to that entry.

Your package is perfect, because it works with SFTP, but I am unable to get it to work with HTTP.

I was thinking of just using Guzzle Wrappers and forking your code, but I Just don't have time and don't know your code well enough, to justify the time/cost investment.

Anyway, if you ever get around to support HTTP streams, or have a recommendation, I would look forward to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant