Appearance
Upload Files To IPFS
Introduction
In this guide, let’s upload files to IPFS. This guide contains the following steps:
- Create a Reddio account
- Upload files to IPFS by clicks
- Upload files to IPFS by API calls
Create a Reddio account
In order to access Reddio's IPFS service, you will need to create a Reddio account:
- Go to the Reddio's dashboard at https://dashboard.reddio.com/
- Click on the "Sign up" button in the buttom right of the page.
- Fill in the registration form with your name, email address, and a password.
- Follow the instruction to input the verify code. Your account will be registered succesfully.
Upload files to IPFS by clicks
Now that you have a Reddio account, you can upload files to IPFS using the dashboard. Here's how to do it:
- Log in to your Reddio's dashboard at https://dashboard.reddio.com/.
- Click on the "IPFS" page in the dashboard.
- Click on the "Upload Files" button and select the file you want to upload.
- After the file(s) is uploaded, clicking on the "Finished" button
- Once the file is uploaded, you'll see a unique IPFS Content Identifier(CID) that represents the file. You can use this Content Identifier(CID) to retrieve the file from the IPFS network.
Upload files to IPFS by API calls
If you prefer to use API calls to upload files to IPFS, you can do so using the Reddio API. Here's how:
- Log in to your Reddio's dashboard at https://dashboard.reddio.com/.
- Retrieve your dashboard ID by looking at URL. For example, https://dashboard.reddio.com/project?id=cc7ec516-4ff5-4626-9401-d38f343afc31 means the project id is "cc7ec516-4ff5-4626-9401-d38f343afc31". Please keep this id.
- Grab your API key from the Reddio dashboard. You can find it under "API Key" in the "Overview" page.
- Prepare the file(s) you want to upload. If you'd like to upload a directory of files, you should convert them to CAR format using
ipfs-car
:
javascript
// convert folder of files to CAR
npm install -g ipfs-car
ipfs-car --pack /path/to/your/directory_name
- Call the
storage
API to upload file(s). You can use followingcURL
statement to upload file(s):
Example: cURL
sh
curl -v -X POST -H 'x-api-key: {your API key}' -F "file=@{your file name}" https://api-dev.reddio.com/v1/project/{project id}/storage
Example: cURL
with parameters
sh
curl -v -X POST -H 'x-api-key: rk-xxxxxx-4326-4b58-ae69-xxxxxxxx' -F "file=@directory_name.car" https://api-dev.reddio.com/v1/project/8e179868-c7ca-49bc-afd7-c178b7b8cf15/storage
- Check
cURL
response, a successful response will look like this:
Example: cURL
response
json
{
"status": "OK",
"data": {
"cid": "bafybeibs4sfygak2sfxxxxpytsuccmhjilcrwsmjus57ntxvyxxxxlpddq",
"endpoints": [
"https://bafybeibs4sfygak2sfxxxxpytsuccmhjilcrwsmjus57ntxvyxxxxlpddq.ipfs.nftstorage.link/"
]
},
"error": ""
}