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

add tarfile/zipfile downloads to HTTP gateway #7746

Closed
DeedleFake opened this issue Oct 30, 2020 · 5 comments · Fixed by #9029
Closed

add tarfile/zipfile downloads to HTTP gateway #7746

DeedleFake opened this issue Oct 30, 2020 · 5 comments · Fixed by #9029
Labels
effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P4 Very low priority status/ready Ready to be worked topic/gateway Topic gateway

Comments

@DeedleFake
Copy link

DeedleFake commented Oct 30, 2020

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.

@DeedleFake DeedleFake added the kind/enhancement A net-new feature or improvement to an existing feature label Oct 30, 2020
@Stebalien Stebalien added exp/intermediate Prior experience is likely helpful effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue P4 Very low priority topic/gateway Topic gateway labels Nov 2, 2020
@Stebalien
Copy link
Member

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.

@lidel
Copy link
Member

lidel commented Nov 6, 2020

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 ipfs/in-web-browsers#170 (something I'd like to help with personally).

@obo20
Copy link

obo20 commented Aug 9, 2021

we've had a few customers ask for this recently. This would be a nice functionality to provide if possible.

@RubenKelevra
Copy link
Contributor

@Stebalien / @lidel can we just add a download button to the directory listings, to download the current view from the current gateway? This would make it MUCH easier for the users.

@lidel
Copy link
Member

lidel commented Jun 8, 2022

CAR

With ?format=car added in #8758 it should be now possible to edit /assets/dir-index-html/src/dir-index.html to add "Download CAR" button that exports current dir index as CAR – if anyone has time to PR, ping me for review 👍

TAR

Doing something similar for TAR is also welcome, but should be a separate PR from CAR (CAR and TAR serve different purposes) and since it is a new behavior, the proposal should come with specs first.

Update: see #9029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P4 Very low priority status/ready Ready to be worked topic/gateway Topic gateway
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants