4EVERLAND Documents
HomeTwitterDiscordBlogs
  • Welcome to 4EVERLAND
  • Get started
    • Our Features
    • Quick Start Guide
      • Registration
      • Login options
        • MetaMask
        • OKX Wallet
        • Binance Web3 Wallet
        • Bitget Wallet
        • Phantom
        • Petra
        • Lilico
      • Usage Introduction
      • Dashboard stats
      • Account
        • Linking Your EVM Wallet to 4EVERLAND Account
        • Balance Alert
    • Billing and Pricing
      • What is LAND?
      • How to Obtain LAND?
      • Pricing Model
      • Q&As
    • Tokenomics
      • $4EVER Token Bridge Tutorial (ETH ↔ BSC)​
  • HOSITNG
    • What is Hosting?
      • IPFS Hosting
      • Arweave Hosting
        • Auto-Generation of Manifest
      • Internet Computer Hosting
      • Greenfield Hosting
    • Guides
      • Creating a Deployment
        • With Git
        • With IPFS Hash
        • With a Template
      • Site Deployment
      • Domain Management
        • DNS Setup Guide
        • ENS Setup Guide
        • SNS Setup Guide
          • The gateway: 4sol.xyz
        • SPACE ID Setup Guide
      • Project Setting
        • Git
      • Troubleshooting
      • Common Frameworks
    • Hosting Templates Centre
      • Templates Configuration File
    • Quick Addition
      • Implement Github 4EVER Pin
      • Github Deployment Button
    • Hosting API
      • Create Project API
      • Deploy Project API
      • Get Task Info API
      • IPNS Deployment Update API
    • Hosting CLI
  • Storage
    • Bucket
      • IPFS Bucket
        • Get Root CID - Snapshots
      • Arweave Bucket
        • Path Manifests
          • Instructions for Building Manifest
          • Auto-Generation of Manifest
        • Arweave Tags
        • Unleash Arweave
      • Guides
      • Bucket API - S3 Compatible
        • Coding Examples
          • AWS SDK - Go (Golang)
          • AWS SDK - Java
          • AWS SDK - JavaScript
          • AWS SDK - .NET
          • AWS SDK - PHP
          • AWS SDK - Python
          • AWS SDK - Ruby
        • S3 Tags Instructions
      • 4EVER Security Token Service API
      • Bucket Tools
      • Bucket Gateway Optimizer
    • 4EVER Pin
      • Guides
      • Pinning Services API
      • IPFS Migrator
    • Storage SDK
  • Gateways
    • IPFS Gateway
    • IC Gateway
    • Arweave Gateway
    • Dedicated Gateways
      • Gateway Access Controls
      • Video Streaming
      • IPFS Image Optimizer
    • IPNS Manager
      • IPNS Manager API
  • RPC
    • Guides
    • API Keys
    • JSON Web Token (JWT)
    • What's CUs/CUPS
    • WebSockets
    • Archive Node
    • Debug API
    • Chains RPC
      • BSC / opBNB
      • Ethereum
      • Optimism
      • Polygon
      • Taiko
  • AI
    • AI RPC
      • Quick Start
      • Models
      • API Keys
      • Requests & Responses
      • Parameters
    • 4EVER Chat
  • RaaS - Beta
    • What's Rollups?
    • 4EVER Rollup Stack
  • DePIN
    • 4EVER Network
    • Storage Nodes
  • More
    • Use Cases
      • Livepeer
      • Lens Protocol
      • Optopia.ai
      • Linear Finance
      • Snapshot
      • Tape
      • Taiko
      • Hey.xyz
      • SyncSwap
    • Community
    • Tutorials
    • Security
    • 4EVERLAND FAQ
Powered by GitBook
On this page
  • Introduction
  • Example
  • Field descriptions
  1. Storage
  2. Bucket
  3. Bucket API - S3 Compatible

S3 Tags Instructions

Last updated 1 year ago

Introduction

When using the Bucket to store files, you can categorize the stored content using tags. Each tag is a key-value pair that you can add to a file when uploading it or add to already uploaded files. You can also query tags using the bucket and file name (Keyname). This method is compatible with AWS S3. For more detailed information about tags, please refer to .

Example

Uploading a file and adding tags

func ExampleS3_PutObject() {
 svc := s3.New(session.New())
 input := &s3.PutObjectInput{
  Body:                 aws.ReadSeekCloser(strings.NewReader("filetoupload")),
  Bucket:               aws.String("examplebucket"),
  Key:                  aws.String("exampleobject"),
  Tagging:              aws.String("key1=value1&key2=value2"),
 }

 result, err := svc.PutObject(input)
 if err != nil {
  if aerr, ok := err.(awserr.Error); ok {
   switch aerr.Code() {
   default:
    fmt.Println(aerr.Error())
   }
  } else {
   // Print the error, cast err to awserr.Error to get the Code and
   // Message from an error.
   fmt.Println(err.Error())
  }
  return
 }

 fmt.Println(result)
}

Adding tags to existing files

func ExampleS3_PutObjectTagging() {
    svc := s3.New(session.New())
    input := &s3.PutObjectTaggingInput{
       Bucket: aws.String("examplebucket"),
       Key:    aws.String("exampleobject"),
       Tagging: &s3.Tagging{
          TagSet: []*s3.Tag{
             {
                Key:   aws.String("Key3"),
                Value: aws.String("Value3"),
             },
             {
                Key:   aws.String("Key4"),
                Value: aws.String("Value4"),
             },
          },
       },
    }

    result, err := svc.PutObjectTagging(input)
    if err != nil {
       if aerr, ok := err.(awserr.Error); ok {
          switch aerr.Code() {
          default:
             fmt.Println(aerr.Error())
          }
       } else {
          // Print the error, cast err to awserr.Error to get the Code and
          // Message from an error.
          fmt.Println(err.Error())
       }
       return
    }

    fmt.Println(result)
}

Requesting the corresponding tag through the bucket and filename

func ExampleS3_GetObjectTagging() {
    svc := s3.New(session.New())
    input := &s3.GetObjectTaggingInput{
       Bucket: aws.String("examplebucket"),
       Key:    aws.String("exampleobject"),
    }

    result, err := svc.GetObjectTagging(input)
    if err != nil {
       if aerr, ok := err.(awserr.Error); ok {
          switch aerr.Code() {
          default:
             fmt.Println(aerr.Error())
          }
       } else {
          // Print the error, cast err to awserr.Error to get the Code and
          // Message from an error.
          fmt.Println(err.Error())
       }
       return
    }

    fmt.Println(result)
}

Field descriptions

Container for the TagSet and Tag elements

Tagging type:map

A collection of a set of tags

TagSet (required): Array<map>

Name of the object key

Key (required) type: String

Value of the tag

Value (required) type: String

The key and value are case-sensitive. For more information about tag limitations, please refer to .

AWS S3 Tag
User-Defined Tag Restrictions