Coder Social home page Coder Social logo

Comments (4)

Firtzberg avatar Firtzberg commented on August 22, 2024

Maybe in File::make() when providing a local file you can change the if statement to
if (file_exists($source) || filter_var($source, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED|FILTER_FLAG_HOST_REQUIRED|FILTER_FLAG_PATH_REQUIRED))

from laravel-zipstream.

Firtzberg avatar Firtzberg commented on August 22, 2024

The more I think about this it appears that you had support for this before creating TempFile and lost it then.

from laravel-zipstream.

jszobody avatar jszobody commented on August 22, 2024

Supporting URLs is tricky.

We need to know the size of the source up front, to calculate the total zip filesize. This is done before any file contents are retrieved. While some URLs would provide a content-length header, many do not. The only way to reliably support URL sources would be to download the entire source contents first, which would block the zip. Large sources would possibly block for some time, which really goes against the entire goal of this package (provide instant-start zip streaming to the end user, with size calculated up front).

That's why so far I've only added support for s:// paths, since we can use the AWS API to lookup the size for those.

from laravel-zipstream.

Firtzberg avatar Firtzberg commented on August 22, 2024

Thank you for the explanation. That makes sense.
It might be possible to do this using the LocalFile with size estimation disabled.

from laravel-zipstream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.