tigris-object-operations

Use when working with objects in Tigris Storage - uploading, downloading, deleting, listing, getting metadata, or generating presigned URLs

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tigris-object-operations" with this command: npx skills add tigrisdata/skills/tigrisdata-skills-tigris-object-operations

Tigris Object Operations

Overview

Tigris Storage provides object operations: upload (put), download (get), delete (remove), list, metadata (head), and presigned URLs.

All methods return TigrisStorageResponse<T, E> - check error property first.

Quick Reference

OperationFunctionKey Parameters
Uploadput(path, body, options)path, body, access, contentType
Downloadget(path, format, options)path, format (string/file/stream)
Deleteremove(path, options)path
Listlist(options)prefix, limit, paginationToken
Metadatahead(path, options)path
Presigned URLgetPresignedUrl(path, options)path, operation (get/put)

Upload (put)

import { put } from "@tigrisdata/storage";

// Simple upload
const result = await put("simple.txt", "Hello, World!");
if (result.error) {
  console.error("Error:", result.error);
} else {
  console.log("Uploaded:", result.data?.url);
}

// Large file with progress
const result = await put("large.mp4", fileStream, {
  multipart: true,
  onUploadProgress: ({ loaded, total, percentage }) => {
    console.log(`${loaded}/${total} bytes (${percentage}%)`);
  },
});

// Prevent overwrite
const result = await put("config.json", config, {
  allowOverwrite: false,
});

Put Options

OptionValuesDefaultPurpose
accesspublic/private-Object visibility
addRandomSuffixbooleanfalseAvoid naming collisions
allowOverwritebooleantrueAllow replacing existing
contentTypestringinferredMIME type
contentDispositioninline/attachmentinlineDownload behavior
multipartbooleanfalseEnable for large files
onUploadProgresscallback-Track upload progress

Download (get)

import { get } from "@tigrisdata/storage";

// Get as string
const result = await get("object.txt", "string");
if (result.error) {
  console.error("Error:", result.error);
} else {
  console.log("Content:", result.data);
}

// Get as file (triggers download in browser)
const result = await get("object.pdf", "file", {
  contentDisposition: "attachment",
});

// Get as stream
const result = await get("video.mp4", "stream");
const reader = result.data?.getReader();
// Process stream...

Get Options

OptionValuesDefaultPurpose
contentDispositioninline/attachmentinlineDownload behavior
contentTypestringfrom uploadMIME type
encodingstringutf-8Text encoding
snapshotVersionstring-Read from snapshot

Delete (remove)

import { remove } from "@tigrisdata/storage";

const result = await remove("object.txt");
if (result.error) {
  console.error("Error:", result.error);
} else {
  console.log("Deleted successfully");
}

List Objects

import { list } from "@tigrisdata/storage";

// List all objects
const result = await list();
console.log("Objects:", result.data?.items);

// List with prefix (folders)
const result = await list({ prefix: "images/" });

// List with pagination
const allFiles = [];
let currentPage = await list({ limit: 10 });
allFiles.push(...currentPage.data?.items);

while (currentPage.data?.hasMore) {
  currentPage = await list({
    limit: 10,
    paginationToken: currentPage.data?.paginationToken,
  });
  allFiles.push(...currentPage.data?.items);
}

List Options

OptionPurpose
prefixFilter keys starting with prefix
delimiterGroup keys (e.g., '/' for folders)
limitMax objects to return (default: 100)
paginationTokenContinue from previous list
snapshotVersionList from snapshot

Object Metadata (head)

import { head } from "@tigrisdata/storage";

const result = await head("object.txt");
if (result.error) {
  console.error("Error:", result.error);
} else {
  console.log("Metadata:", result.data);
  // { path, size, contentType, modified, url, contentDisposition }
}

Presigned URLs

import { getPresignedUrl } from "@tigrisdata/storage";

// Presigned URL for GET (temporary access)
const result = await getPresignedUrl("object.txt", {
  operation: "get",
  expiresIn: 3600, // 1 hour
});
console.log("URL:", result.data?.url);

// Presigned URL for PUT (allow client upload)
const result = await getPresignedUrl("upload.txt", {
  operation: "put",
  expiresIn: 600, // 10 minutes
});

Presigned URL Options

OptionValuesDefaultPurpose
operationget/put-URL purpose
expiresInseconds3600URL expiration
contentTypestring-Require for PUT

Common Mistakes

MistakeFix
Not checking error firstAlways check if (result.error) before result.data
Wrong format in get()Use 'string', 'file', or 'stream'
Forgetting multipart: trueEnable for files >100MB
Ignoring paginationUse hasMore and paginationToken

Client-Side Uploads

For browser uploads, use the client package to upload directly to Tigris:

import { upload } from "@tigrisdata/storage/client";

const result = await upload(file.name, file, {
  url: "/api/upload", // Your backend endpoint
  onUploadProgress: ({ percentage }) => {
    console.log(`${percentage}%`);
  },
});

For initial setup, see installing-tigris-storage.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

tigris-snapshots-forking

No summary provided by upstream source.

Repository SourceNeeds Review
General

installing-tigris-storage

No summary provided by upstream source.

Repository SourceNeeds Review
General

tigris-bucket-management

No summary provided by upstream source.

Repository SourceNeeds Review