DEV Community

René Hansen
René Hansen

Posted on

Listing the contents of a remote ZIP archive with Ruby

Below is a small Ruby utility function, which takes a url of a ZIP archive and returns the file names of its content.

It will only download just enough data to list the archive content and no more.

The code comments should reveal what the individual steps does, but in case you like a more in-depth look at things, I wrote a blog post here, with accompanying curl commands:

https://rhardih.io/2021/04/listing-the-contents-of-a-remote-zip-archive-without-downloading-the-entire-file.

Top comments (0)