I have a number of things that I have backed up to an IPFS cluster that I'm running. I'd like to be able to download an entire directory as an archive of some kind, either a tarball or a zipfile, through the gateway, but there doesn't seem to be a way to do this. I looks around for a while, but was unable to find anything about downloading directories in any way via the gateway, other than one file at a time.
Would it be possible for the gateway to get the ability to add a query parameter, like ?format=zip or something, that, when given on a directory path, results in a zipfile containing the contents of the directory instead of the usual UI?
If this makes sense, a link being added to the gateway's directory UI to download the current directory would be a nice corollary.
You can use the read-only API: https://your-gateway/api/v0/get?arg=/the/path/you/want. That will give you a.tar` file (with the incorrect content type, apparently...).
But I agree making this a gateway feature and linking to it from the directory index would be really nice.
Support for ?download=tar|tgz|tar.gz (ipfs get) could be easy to wire up, and I believe we could do that while we add support for ?download=car (ipfs dag export), as suggested in https://github.com/ipfs/in-web-browsers/issues/170 (something I'd like to help with personally).
Most helpful comment
Support for
?download=tar|tgz|tar.gz(ipfs get) could be easy to wire up, and I believe we could do that while we add support for?download=car(ipfs dag export), as suggested in https://github.com/ipfs/in-web-browsers/issues/170 (something I'd like to help with personally).