Filebase
HomepageFilebase DashboardDiscordBlog
  • 👋Welcome to Filebase!
  • Getting Started
    • FAQ
    • Service Limits
    • Getting Started Guides
      • Pin Your First File To IPFS
      • Developer Quick Start Guide
  • IPFS Concepts
    • What is IPFS?
    • What is an IPFS CID?
    • What is IPFS Pinning?
    • What is an IPFS Gateway?
  • IPFS Pinning
    • Pinning Files
    • Listing Files
    • Deleting Files
    • Event Notifications
  • IPNS Names
    • Managing Names
  • Dedicated IPFS Gateways
    • Managing Dedicated Gateways
    • Access Controls
    • Image Optimizations
    • Adding a Custom Domain
  • API Documentation
    • IPFS RPC API
    • S3-Compatible API
      • Cross Origin Resource Sharing (CORS)
        • Create and Apply a CORS Rule to a Filebase Bucket
        • Deep Dive: Cross Origin Resource Sharing (CORS)
      • Pre-Signed URLs
    • Filebase Platform APIs
    • IPFS Pinning Service API
  • Code Development + SDKs
    • Code Development
      • Apache Libcloud - Python
      • Apostrophe CMS
      • AWS Lambda - NodeJS
      • AWS Lambda - Python
      • AWS SDK - Go (Golang)
      • AWS SDK - Java
      • AWS SDK - JavaScript
      • AWS SDK - .NET
      • AWS SDK - PHP
      • AWS SDK - Python
      • AWS SDK - Ruby
      • Code Examples
        • How To Utilize Filebase with NodeJS
      • DataCamp
      • Dart / Flutter
      • Django
      • Docker
        • Docker Volume Backup
      • Elixir Phoenix
      • Filebase NPM Package
      • Fog.io - Ruby
      • Google App Scripts
      • Integrated Haskell Platform
      • Laravel
      • Nuxt
      • Paperspace
      • Postman
      • Reading a JSON File
      • UNA
      • Unity
      • Uppy AWS S3 Plugin
      • Vue
      • Watcher for NodeJS
      • Webpack S3 Plugin
      • Xamarin
    • SDK Examples: Pinning Files and Folders to IPFS
      • AWS SDK for .NET
      • AWS SDK for Go
      • AWS SDK for JavaScript
      • AWS SDK for PHP
      • AWS SDK for Python
      • AWS SDK for Ruby
  • Archive
    • Content Archive
      • IPFS Getting Started Guide
      • Web Console Getting Started Guide
      • IPFS Tools
        • IPFS CLI
        • IPFS Desktop
        • IPFS Pin Sync
        • IPFS Pinning Service API
        • IPFS3up
      • Third Party Tools and Clients
        • Backup Client Configurations
          • AhsayCBS
          • BackupAssist Classic
          • BackupAssist ER
          • BackupNinja
          • BackupSheep
          • Bacula Enterprise Edition
          • CloudBacko
          • CloudBerry Backup
          • Cloudron
          • cPanel
          • Comet
          • Commvault
          • Duplicacy
          • Ghost IPFS Storage Adapter
          • IPFS Pinning GitHub Action
          • JetBackup
          • Kopia
          • MoveBot
          • MSP360 Online Backup
          • oDrive
          • Photos+ Cloud Library
          • qBackup
          • S3 Uploader for GitHub Actions
          • SimpleBackups
          • SnapShooter
          • Strapi Provider Plugin
          • Veeam
          • Wordpress
            • Media Cloud
            • XCloner
          • Zerto
        • CLI Tools
          • Ansible
          • Apache Pulsar
          • AWS CLI
            • How To Delete Data with AWS CLI
            • What is Multipart Upload?
          • Bash
            • Backup Files to IPFS with Bash
            • Laravel Backup with Bash
            • MongoDB Backup with Bash
            • PostgreSQL Backup with Bash
            • Wordpress Backup with Bash
          • cURL
          • Elasticsearch
          • IPFS-CAR
          • IPFScrape
          • IPGet
          • Jenkins
          • JFrog Artifactory
          • Kubernetes
            • Backup and Restore InFluxDB to Filebase with TrilioVault
            • CSI-S3
            • Kasten K10
            • Kerberos Vault
            • Longhorn.io
            • Stash for Kubernetes
            • Velero
          • Litestream
          • Minty
          • MongoDB
          • MoSMB
          • MySQL
          • Next.js .CAR File Upload
          • NFT Image Generator
          • NGINX S3 Gateway
          • Pinning Docker Images to IPFS
          • Pinning Encrypted Files to IPFS
          • PowerShell
            • Calculate the Size of Filebase Buckets using PowerShell
          • Rclone
            • Backing Up DigitalOcean Spaces to Filebase using Rclone
          • Restic
          • S3cmd
          • S3Express
          • S3FS-FUSE
          • S3QL
          • S3Surfer
          • S4cmd
          • SeaweedFS
          • Tableland
        • Content Delivery Networks
          • Bunny CDN
          • CloudFront CDN
          • Fastly CDN
        • File Management Client Configurations
          • Airbyte
          • Arq
          • Astiga
          • AWS Rekognition
          • AWS S3 Manager - iOS App
          • BucketAnywhere for S3 - Android App
          • CentreStack
          • CloudFlyer
          • Cloudfser
          • Couchdrop
          • CrossFTP
          • CyberDuck
            • How To Delete Data with CyberDuck
          • Dropshare
          • Duplicati
          • FileBrowserGO
          • Flexify.IO
          • ForkLift
          • Goofys
          • Joplin
          • LucidLink
          • MASV
          • Matrix Synapse
          • MinIO Gateway for S3
          • Mountain Duck
          • NetDrive
          • Nexfs
          • NextCloud
          • Nodeum
          • ownCloud
          • Plesk
          • Pure Storage FlashBlade
          • RaiDrive
          • S3 Browser
          • ShareX
          • SmartFTP
          • StableBit Cloud Drive
          • Storage Made Easy Enterprise File Fabric
          • WinSCP
        • NAS Device Configurations
          • Buffalo TeraStation
          • Datadobi DobiProtect
          • Netapp ONTAP Select
          • OpenDrives Atlas
          • Synology Hyper Backup
          • TrueNAS CORE
      • Knowledge Base
        • Deep Dives
          • Deep Dive: Blockchains
          • Deep Dive: Decentralized Compute
          • Deep Dive: Decentralized Digital Identity
          • Deep Dive: Decentralized Storage
          • Deep Dive: Erasure Coding
          • Deep Dive: Geo-Redundancy
          • Deep Dive: Metadata
          • Deep Dive: Metaverse
          • Deep Dive: NFTs
          • Deep Dive: Web3
        • Filebase eBooks
        • Filebase One-Pagers
        • Filebase Whitepapers
        • Web3 Tutorials
          • Alchemy
            • Alchemy: Build a dApp That Provides Real-Time Ethereum Transaction Notifications
            • Alchemy: Create a Full-Stack dApp
            • Alchemy: Create a Hello World Smart Contract
            • Alchemy: Create Your Own ERC20 Cryptocurrency
            • Alchemy: Decentralized Youtube
            • Alchemy: How to Create and Mint an NFT using Filebase
            • Alchemy: How to Mint an NFT Using Web3.js
            • Alchemy: Using The Alchemy SDK with NFTs Minted Through thirdweb
          • Agoric
            • Agoric: Create a DeFi dApp Using Agoric That’s Stored on Filebase
          • AirSwap
            • AirSwap: Track NFT Contract Addresses with AirSwap CLI
          • ArcBlock
            • ArcBlock: Running an ArcBlock Blocket Server on IPFS
          • Ankr
            • Ankr: Create a Truffle Project with Ankr and Filebase
            • Ankr: Deploy a Smart Contract on Polygon using Ankr that is backed up to Filebase
          • Avalanche
            • Avalanche: How To Launch a Generative NFT Collection With Avalanche and IPFS
          • Backing Up NFTs
          • Brownie
            • Brownie: Create and Mint an NFT Using Brownie
          • Bueno
            • Bueno: How to Create a Generative NFT Collection with Bueno
          • Cardano
            • Cardano: Submit Cardano Blockchain Transactions with Embedded Metadata Stored on Filebase
          • Ceramic
            • Ceramic: How to Host a Ceramic Node Using Decentralized Storage
          • Create-IPFS-app
          • Cosmos
            • Cosmos: Storing Cosmos Chain Governance Metadata on IPFS
          • DeCommerce
          • Ethereum Name Service
            • ENS: Configure an ENS Domain to use a Filebase IPFS Dedicated Gateway
          • Figment Datahub
            • Figment Datahub and Avalanche: Make an e-Voting dApp Using Figment Datahub, Avalanche, and Filebase
            • Figment Datahub and Celo Network: Create an ERC1155 NFT on the Celo Network using Figment Datahub and Objects Stored on Filebase
          • Flow
            • Flow: How to Create an NFT Marketplace with Filebase + Flow
          • Fauna
            • Fauna: Host an Application on IPFS with IPFS Dedicated Gateways
          • Ganache
            • Ganache: Create a dApp Hosted on IPFS
          • GUN
            • GUN: Create a Decentralized Chat App with GUN and IPFS
          • Hardhat
            • Hardhat: Creating an NFT Contract using Hardhat and Setting NFT Metadata using IPFS on Filebase
          • Harmony
            • Harmony: Deploy an HRC721 NFT on Harmony with IPFS
          • Hosting a Form on IPFS
          • iExec
            • iExec: Using iExec and Tee Worker to Create Apps that Use Datasets Stored on Filebase
          • Infura
            • Infura: Build dApp Frontends with Infura, React, and IPFS
            • Infura: Create an NFT Contract Factory with Metadata stored on IPFS
          • Lens Protocol
            • Lens Protocol: Build a Decentralized Social Media Network Stored on IPFS
          • LIT Protocol
            • LIT Protocol: Create a MintLIT NFT with LIT Protocol and IPFS
          • LivePeer
            • LivePeer: Mint a Video NFT with LivePeer
          • Macrometa
            • Macrometa: Track IPFS Files with Macrometa
          • Mina Protocol
            • Mina Protocol: Create a Simple zkApp with Mina Protocol and IPFS
          • NEAR Protocol
            • NEAR Protocol: Storing Off-Chain Data on IPFS using Filebase
          • NFTPort
            • NFTPort: Create an NFT Collection with NFTPort
          • Ocean Protocol
            • Ocean Protocol: Publish Data NFTs Stored on IPFS using Ocean Protocol
          • Pin Tezos Tokens Tool
          • Polkadot
            • Polkadot: Deploy a Polkadot dApp on Decentralized Storage
          • Polygon
            • Polygon: Building an App NFT With Polygon
            • Polygon: Make a Donation App with IPFS and Polygon
          • Python
            • Generating NFT Metadata with Python
          • QuickNode
            • QuickNode: Create a Token dApp using QuickNode
          • Remix
            • Remix: Create a Web App with Remix to Upload to Decentralized Storage
          • Remix IDE
            • Remix IDE: Creating Interactive NFTs with IPFS and Remix IDE
          • Secret Network
            • Secret Network: Create an NFT on Secret Network with Data Stored on IPFS
          • Stargaze
            • Stargaze: Create an NFT Collection Using IPFS and Stargaze
          • Starknet
            • Starknet: Create a HardHat Project Using A Starknet Plugin Hosted On IPFS
          • Studio 721
            • Studio 721: Create an NFT Collection with Studio 721 and IPFS
          • Solana
            • Solana: Minting an NFT Using Sugar, Candy Machine, and Filebase
          • Subsquid
            • Subsquid: Querying NFT Data using Subsquid and a Filebase IPFS Dedicated Gateway
          • Tailwind CSS
            • Tailwind CSS: Build an Image Gallery App with IPFS and Tailwind CSS
          • Tatum
            • Tatum: How To Mint NFTs on Solana with Tatum
          • Tezos
            • Tezos: Create an NFT on the Tezos Network using IPFS on Filebase
          • thirdweb
            • thirdweb: Build an NFT Loot Box with thirdweb and IPFS
            • thirdweb: Build an NFT Minting Page with thirdweb, IPFS, RainbowKit, and WAGMI
            • thirdweb: Create a Discord Bot That Gives Roles to NFT Holders
            • thirdweb: Create a Gated Website Using NFTs and IPFS
            • thirdweb: Create an NFT Marketplace with thirdweb and IPFS
            • thirdweb: Release an NFT Drop Using thirdweb and IPFS
          • useDApp
            • useDApp: Create a dApp using useDApp and IPFS
          • Unstoppable Domains
            • Unstoppable Domains: Create a Decentralized Website Using Unstoppable Domains and IPFS Folders
            • Unstoppable Domains: Deploy a Decentralized Blog Using Unstoppable Domains, Akash, and IPFS
            • Unstoppable Domains: IPFS Configuration
          • Vultr
            • Vultr: Store Bedrock Minecraft Worlds on Decentralized Storage
            • Vultr: Store Forge Minecraft Worlds on Decentralized Storage
            • Vultr: Store PaperSpigot Minecraft Worlds on Decentralized Storage
            • Vultr: Store Vanilla Minecraft Worlds on Decentralized Storage
          • Waffle
            • Waffle: Deploy a Smart Contract with Waffle That’s Stored on IPFS
          • Walt.id
            • Walt.id: Mint an NFT with Walt.id and Filebase
          • Web3 Toolbox
            • Web3 Toolbox: Building an NFT Drop With Web3 Toolbox
Powered by GitBook
On this page
  • AWS SDK for JavaScript
  • Declare the S3 Client
  • Retrieving Buckets
  • Creating a Bucket
  • Listing Files in a Bucket
  • Uploading Objects
  • Returning The Object’s IPFS CID Once Uploaded
  • Uploading a Folder to IPFS
  • IPFS CLI
  • Configure Filebase As a Pinning Service
  • To Pin a CID Into Your Filebase Bucket:
  • To List All Pinned Files In Your Filebase Bucket:
  • To List All Pins That Are Queued, Pinning, Or Failed:
  • AWS CLI
  • Configuration
  • Creating a New Bucket
  • Listing Buckets
  • Listing the Content of a Bucket
  • Uploading a File to IPFS
  • Uploading a Folder to IPFS
  • IPFS Pinning Service API

Was this helpful?

  1. Getting Started
  2. Getting Started Guides

Developer Quick Start Guide

Learn how to get started with IPFS through Filebase with the AWS SDK for JavaScript, IPFS CLI tool, and the AWS CLI tool.

PreviousPin Your First File To IPFSNextWhat is IPFS?

Last updated 10 months ago

Was this helpful?

Filebase supports uploading and managing content on IPFS through our S3-compatible API or the IPFS pinning service API, creating a wide variety of workflows for developers to incorporate into their projects and workflows.

This quick start guide will cover some of the most common utilizations of Filebase in developer workflows, including using the AWS SDK for JavaScript, the IPFS CLI tool, and AWS CLI.

AWS SDK for JavaScript

AWS SDKs (software development kits) help simplify coding and application development by supporting and providing code objects for use with S3-compatible services. There are a variety of different AWS SDKs, each for a different coding language. This guide covers AWS SDK - JavaScript.

The AWS SDK for JavaScript supports three runtimes:

  • JavaScript

  • Node.js

  • React Native for mobile development

AWS SDK - JavaScript also supports cross-runtime. Cross-runtime is a service client package that can be run on browsers, Node.js, and React-Native without needing any change to the code.

Prerequisites:

Declare the S3 Client

The following code example defines the S3 client and does not return any output. Replace the following values in the code to match your configuration:

  • accessKeyId: Your Filebase Access Key

  • secretAccessKey: Your Filebase Secret Key

const AWS = require('aws-sdk');

const s3 = new AWS.S3({
  apiVersion: '2006-03-01',
  accessKeyId: 'Filebase-Access-Key',
  secretAccessKey: 'Filebase-Secret-Key',
  endpoint: 'https://s3.filebase.com',
  region: 'us-east-1',
  s3ForcePathStyle: true
});

Retrieving Buckets

The following code example returns a list of buckets under your Filebase account. Replace the following values in the code to match your configuration:

  • accessKeyId: Your Filebase Access Key

  • secretAccessKey: Your Filebase Secret Key

const AWS = require('aws-sdk');

const s3 = new AWS.S3({
  apiVersion: '2006-03-01',
  accessKeyId: 'Filebase-Access-Key',
  secretAccessKey: 'Filebase-Secret-Key',
  endpoint: 'https://s3.filebase.com',
  region: 'us-east-1',
  s3ForcePathStyle: true
});

s3.listBuckets(function (err, data) {
  if (err) {
    console.log("Error when listing buckets", err);
  } else {
    console.log("Success when listing buckets", data);
  }
});

Creating a Bucket

The following code example creates a new Filebase bucket. Replace the following values in the code to match your configuration:

  • accessKeyId: Your Filebase Access Key

  • secretAccessKey: Your Filebase Secret Key

  • Bucket: Your Filebase Bucket Name To Be Created

Bucket names must be unique across all Filebase users, be between 3 and 63 characters long, and can contain only lowercase characters, numbers, and dashes.

Buckets created through this method will be automatically created on the IPFS network.

const AWS = require('aws-sdk');

const s3 = new AWS.S3({
  apiVersion: '2006-03-01',
  accessKeyId: 'Filebase-Access-Key',
  secretAccessKey: 'Filebase-Secret-Key',
  endpoint: 'https://s3.filebase.com',
  region: 'us-east-1',
  s3ForcePathStyle: true
});

const params = {
    Bucket: "New-Filebase-Bucket"
}

s3.createBucket(params, (err, data)=>{
    if(err){
        console.log(err)
    } else {
        console.log("Bucket created", data)
    }
})

Listing Files in a Bucket

The following code example returns a list of objects in the bucket name provided. Replace the following values in the code to match your configuration:

  • accessKeyId: Your Filebase Access Key

  • secretAccessKey: Your Filebase Secret Key

  • Bucket: Your Filebase Bucket Name

const AWS = require('aws-sdk');

const s3 = new AWS.S3({
  apiVersion: '2006-03-01',
  accessKeyId: 'Filebase-Access-Key',
  secretAccessKey: 'Filebase-Secret-Key',
  endpoint: 'https://s3.filebase.com',
  region: 'us-east-1',
  s3ForcePathStyle: true
});

const params = {
  Bucket: "filebase-bucket",
  MaxKeys: 20
};

s3.listObjectsV2(params, function (err, data) {
  if (err) {
    console.log("Error when listing objects", err);
  } else {
    console.log("Success when listing objects", data);
  }
});

Uploading Objects

The following code example uploads an object to the bucket name provided. Replace the following values in the code to match your configuration:

  • accessKeyId: Your Filebase Access Key

  • secretAccessKey: Your Filebase Secret Key

  • Bucket: Your Filebase Bucket Name

  • Key: The Local Path To The Object To Be Uploaded

  • Content Type: The Type of Object Being Uploaded

const AWS = require('aws-sdk');

const s3 = new AWS.S3({
  apiVersion: '2006-03-01',
  accessKeyId: 'Filebase-Access-Key',
  secretAccessKey: 'Filebase-Secret-Key',
  endpoint: 'https://s3.filebase.com',
  region: 'us-east-1',
  s3ForcePathStyle: true
});

const params = {
  Bucket: 'filebase-bucket',
  Key: '/path/to/file/filename.png',
  ContentType: 'image/png',
  Body: myPictureFile,
  ACL: 'public-read',
};

const request = s3.putObject(params);
request.send();

Returning The Object’s IPFS CID Once Uploaded

To return an object’s IPFS CID once it has been uploaded, you will need to return the x-amz-meta-cid header. The following code example uploads an IPFS file to the bucket name provided and returns the IPFS CID. Replace the following values in the code to match your configuration:

  • accessKeyId: Filebase Access Key

  • secretAccessKey: Filebase Secret Key

  • Bucket: Your Filebase Bucket Name

  • Key: The Local Path To The Object To Be Uploaded To IPFS

const AWS = require('aws-sdk');
const fs = require('fs');

const s3 = new AWS.S3({
    endpoint: 'https://s3.filebase.com',
    region: 'us-east-1',
    signatureVersion: 'v4',
});

fs.readFile('image.png', (err, data) => {
    if (err) {
        console.error(err);
        return;
    }
    
    const params = {
        Bucket: 'my-ipfs-bucket',
        Key: 'test/image.png',
        ContentType: 'image/png',
        Body: data,
        Metadata: { import: "car" }
    };
    
    const request = s3.putObject(params);
    request.on('httpHeaders', (statusCode, headers) => {
        console.log(`CID: ${headers['x-amz-meta-cid']}`);
    });
    request.send();
});

Uploading a Folder to IPFS

Download the ipfs-car package with the following command:

git clone https://github.com/web3-storage/ipfs-car

Install the ipfs-car package:

npx ipfs-car

Next, use ipfs-car to package a folder of files into a .car file.

This has been tested with .car archives containing 10,000 or more files. Use either of the following commands, depending on your desired workflow:

Write a .car file to the current working directory

ipfs-car --pack path/to/file/or/dir

Write a .car file to a specific directory with a specified name

ipfs-car --pack path/to/files --output path/to/write/ipfs-car.car

Create a new file with the following AWS SDK for JavaScript code:

The following code example uploads an IPFS folder to the bucket name provided and returns the folder’s CID value. Replace the following values in the code to match your configuration:

  • accessKeyId: Filebase Access Key

  • secretAccessKey: Filebase Secret Key

  • Bucket: Your Filebase Bucket Name

  • Key: The Local Path To The Object To Be Uploaded To IPFS

const AWS = require('aws-sdk');
const fs = require('fs');

const s3 = new AWS.S3({
    endpoint: 'https://s3.filebase.com',
    region: 'us-east-1',
    signatureVersion: 'v4',
});

fs.readFile('image.png', (err, data) => {
    if (err) {
        console.error(err);
        return;
    }
    
    const params = {
        Bucket: 'my-ipfs-bucket',
        Key: 'test/image.png',
        ContentType: 'image/png',
        Body: data,
        Metadata: { import: "car" }
    };
    
    const request = s3.putObject(params);
    request.on('httpHeaders', (statusCode, headers) => {
        console.log(`CID: ${headers['x-amz-meta-cid']}`);
    });
    request.send();
});

IPFS CLI

IPFS CLI is a command line tool that can be used to interact with IPFS. It can be configured to utilize different IPFS pinning services such as Filebase through the ipfs pin remote commands.

Read below to learn how to use IPFS CLI with Filebase.

Prerequisites:

Configure Filebase As a Pinning Service

To add Filebase as a pinning service, use the following command:

ipfs pin remote service add filebase https://api.filebase.io/v1/ipfs access-token

Then copy the generated Secret Access Token:

To Pin a CID Into Your Filebase Bucket:

ipfs pin remote add --service=filebase --name=test.png QmSp5z5RAgDhS38w7TmLMfyDXvY9i2hF6sJ4qm62SK5939

To List All Pinned Files In Your Filebase Bucket:

ipfs pin remote ls --service=filebase

To List All Pins That Are Queued, Pinning, Or Failed:

ipfs pin remote ls --service=filebase --status=queued,pinning,failed

AWS CLI

AWS CLI, or Amazon Web Services Command Line Interface, is a command line tool developed by Amazon using Python that is used for transferring data to object storage services. This is one of the most commonly used CLI tools by IT system administrators, developers, and programmers. Even though this tool is developed by Amazon, you can use it with any S3-compatible API object storage service, including Filebase, to manage your storage objects and buckets.

Prerequisites:

Configuration

First, configure AWS CLI to work with Filebase and your Filebase account. To do this, open a new terminal window. From there, run the command:

aws configure

This command will generate a series of prompts, which should be filled out as such:

  • Access Key ID: Filebase Access Key

  • Secret Access Key: Filebase Secret Key

  • Region: us-east-1

  • Output Format: Optional

After completing the prompt, begin interacting with the Filebase S3 API using the AWS CLI tool. You will not need to configure AWS CLI again as long as your Access ID and Secret Access Key does not change.

All AWS CLI commands will begin with aws --endpoint https://s3.filebase.com

Creating a New Bucket

To create a new bucket on Filebase using the AWS CLI, use the command:

aws --endpoint https://s3.filebase.com s3 mb s3://[bucket-name]

Bucket names must be unique across all Filebase users, be between 3 and 63 characters long, and can contain only lowercase characters, numbers, and dashes.

Listing Buckets

The following command will list all buckets in your Filebase account:

aws --endpoint https://s3.filebase.com s3 ls

Listing the Content of a Bucket

To list the contents of a bucket, use the command:

aws --endpoint https://s3.filebase.com s3 ls s3://[bucket-name]

Uploading a File to IPFS

The CID will be returned in the response of a PutObject call. For example, if we run the following AWS CLI command:

aws --endpoint https://s3.filebase.com s3 cp test-images/7FIMFhlMf6A.jpg s3://ipfs-test --debug

The response is shown below. For convenience, we've highlighted the respective response header:

You can also call the HeadObject API to fetch the CID at any time as well:

aws --endpoint https://s3.filebase.com s3api head-object --bucket ipfs-test --key 7FIMFhlMf6A.jpg

Uploading a Folder to IPFS

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.

For instructions on how to create a CAR file, check out our guide here:

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.

Below is an example using the AWS CLI, which adds the x-amz-meta prefix automatically:

aws --endpoint https://s3.filebase.com s3 cp pictures.car s3://ipfs-test --debug --metadata 'import=car'

With the specified –debug flag, the response headers are shown, which reveal the CID:

2022-06-14 19:51:41,400 - ThreadPoolExecutor-0_2 - botocore.parsers - DEBUG - Response headers:

{
'Date': 'Tue, 14 Jun 2022 23:51:41 GMT',
'Content-Type': 'application/xml'
'Transfer-Encoding': 'chunked',
'Connection': 'keep-alive',
'x-amz-meta-cid': 'bafybeieurpeyzighqrvwjqyj3szuvbqvrbijm7cdair5a422ipf2d5qnlq',
'ETag': 'W/"d8cad258a3d9bbe03a26a13a3ec43b21"',
'x-amz-request-id': '144e0415-8162-45cd-b071-e51dada956ae',
'x-amz-id-2': 'ZmlsZWJhc2UtNmQ3ZjQ5OGZmZC14ejk1Mg==',
'Server': 'Filebase'

}

IPFS Pinning Service API

To learn more about using our IPFS Pinning Service API, check out our API documentation page here:

This example uses the AWS SDK v2. For an example using the AWS SDK v3, please see .

IPFS CLI.

for a free Filebase account.

Have your Filebase Access and Secret Keys. Learn how to view your access keys .

Create a Filebase IPFS Bucket. Learn how to create a bucket .

Replace access-token with your Filebase IPFS Pinning Service token. The access-token can be generated by navigating to the , then viewing the IPFS PInning Service API Endpoint. Click the drop down menu for 'Choose Bucket to Generate Token', then choose the IPFS Filebase Bucket you want to use.

for a free Filebase account.

Note the Filebase API endpoint -

Download and install
Download and install
Sign up
here
here
Download and install
Sign up
here
here
Filebase Access Keys page
Download and install the AWS CLI tool.
Sign up
https://s3.filebase.com
IPFS-CAR
IPFS Pinning Service API