Ethan Wells
Ethan Wells

Reputation: 67

IPFS Download content of folder with folder's HASH

There is a folder on IPFS with the following hash: QmQGQU13hzouofHiMbXSstFJJxAkr6kgfahaxBtZFG8PEn

How can I view/download all data contained within this folder on IPFS?

Upvotes: 1

Views: 3400

Answers (2)

DaWe
DaWe

Reputation: 1702

There are download endpoints on all gateways, but they are not really consistent for me (maybe they have a file size limit, timeout, etc). You can try something like this:

https://ipfs.io/ipfs/CID?download=true&format=tar&filename=Filename.tar

Try multiple gateways, eg. CloudFlare:

https://cloudflare-ipfs.com/ipfs/bafkreibm6jg3ux5qumhcn2b3flc3tyu6dmlb4xa7u5bf44yegnrjhc4yeq?download=true&format=tar&filename=Hello.tar

No download, just folder page? Try to download a CAR instead of TAR:

https://ipfs.io/ipfs/CID?download=true&format=tar&filename=Filename.car

Car also has the advantage of preserving the IPFS structure - so you can re-upload the folder later under the same CID (which is hard to reproduce without car)

Upvotes: 2

rambi
rambi

Reputation: 1259

If you can install the ipfs tools, just look at the doc:

https://docs.ipfs.io/basics/command-line/#remove-a-file

For example, ipfs ls <hash> will show you the content of the folder.

Otherwise, just use an ipfs gateway :

https://ipfs.io/ipfs/QmQGQU13hzouofHiMbXSstFJJxAkr6kgfahaxBtZFG8PEn

But know that if nobody is online with the content of this ipfs directory, you will not be able to get it.

Upvotes: 2

Related Questions