IPFS-CAR
Learn how to convert files and folders into content-addressable archive (.car) files and upload them to IPFS through Filebase.
Last updated
Was this helpful?
Learn how to convert files and folders into content-addressable archive (.car) files and upload them to IPFS through Filebase.
Last updated
Was this helpful?
A .car file is a type of compressed archive file that contains multiple files, similar to a ZIP file. .car files are used by the FileCoin and IPFS networks, which utilize the metadata fields to include the IPFS CIDs of each file within the archive.
Filebase supports uploading .car files to IPFS using the S3-compatible API through the PutObject or MultipartUpload methods.
Read below to learn how to convert files and folders into content-addressable archive (.car) files and upload them to IPFS through Filebase.
git clone https://github.com/web3-storage/ipfs-car
npx ipfs-car
This has been tested with .car archives containing 10,000 or more files. Use any of the following commands, depending on your desired workflow:
ipfs-car --pack path/to/file/or/dir
ipfs-car --pack path/to/files --output path/to/write/a.car
ipfs-car --list-cids path/to/my.car
ipfs-car --list path/to/my.car
aws --endpoint https://s3.filebase.com s3 cp file-name.car s3://bucket-name --debug --metadata 'import=car'
Replace file-name
with your .car file name, and bucket-name
with your Filebase IPFS bucket name. Below is an example:
aws --endpoint https://s3.filebase.com s3 cp TEST_CAR.car s3://ipfs-test --debug --metadata 'import=car'
When you upload a .car file, you can pass an S3 metadata header of x-amz-meta-import: car
along with the request. Filebase will then import the file as a .car, and return the resulting CID.
With the specified –debug
flag, the response headers are shown, which reveal the CID:
To learn more about ipfs-car and for additional use cases using the ipfs-car API, see the ipfs-car documentation .