AWS SDK - JavaScript
Please read the following to understand how to use the AWS SDK - JavaScript with the 4EVERLAND Bucket. Combine the AWS SDK API for the JavaScript language with the 4EVERLAND Bucket to achieve file uploads to the IPFS or Arweave storage networks.
Preparation
Download and install the AWS SDK for JavaScript.
Register a free 4EVERLAND account.
If you need to use Arweave storage, you need to create an Arweave bucket. Click to learn more.
To obtain the corresponding API key in the bucket, click to learn more.
Development Examples
Install the S3 client
The following code example defines an S3 client and does not return any output. Replace the values in the code below to complete your configuration:
endpoint
:https://endpoint.4everland.co
accessKey
:Bucket-Access Keys-API Key
secretKey
:Bucket-Access Keys-API Secret
region
: Default filled in with "4everland"
Create a bucket
bucket
: The desired bucket name to create
Upload a file
bucket
: Your bucket name
Key
: The file path for the file to be uploaded
ContentType
: The type of the file to be uploaded
List the files in the bucket
Bucket
: Your bucket name
Prefix
: Files will be listed according to the provided path. When the input is empty, all files in the bucket will be listed
Requesting IPFS CID and Arweave Hash
Bucket
: The bucket name where the target file is stored
Key
: The path of the target file
If you have any questions, please join our Discord server, or send us an email at contact@4everland.org.
Last updated