Home ci 28. storage: epycbyte blob

28. storage: epycbyte blob

Last updated on Aug 05, 2025

Epycbyte Blob Documentation

Use Cases

  • Store and serve large files
  • Organize files with folders and slashes
  • Support range requests for partial downloads
  • Track upload progress
  • Abort ongoing operations
  • Delete all blobs in a store

Getting Started

  1. Create an account on Epycbyte.
  2. Install the Epycbyte Blob SDK.
  3. Import the necessary modules.

Using Epycbyte Blob in Your Workflow

Server Upload Quickstart

Learn how to upload files to Epycbyte Blob using Server Actions or Route Handlers.

Client Upload Quickstart

Learn how to upload files to Epycbyte Blob using the Epycbyte Blob SDK.

Epycbyte Blob SDK

Learn how to use the Epycbyte Blob SDK.

Security

  • Encryption is supported.
  • Access control is available.

Viewing and Downloading Blobs

  • Use the get method to retrieve a blob.
  • Use the list method to list all blobs in a store.

Caching

  • Epycbyte Blob supports caching for frequently accessed files.
  • Caching can be enabled or disabled using the cache parameter.

Folders and Slashes

  • Epycbyte Blob supports folders and slashes in file paths.
  • Folders are not actual directories, but rather a way to organize blobs.

Example: Creating a Folder

const blob = await put('folder/file.txt', 'Hello World!', { access: 'public' });

Range Requests

  • Epycbyte Blob supports range requests for partial downloads.
  • Range requests can be made using the curl command or other tools.

Example: Downloading a File with Range Request

curl -r 0-4 https://1sxstfwepd7zn41q.public.blob.epycbyte-storage.com/range-requests.txt

Upload Progress

  • Epycbyte Blob provides an onUploadProgress callback to track upload progress.
  • The callback is available on the put and upload methods.

Example: Tracking Upload Progress

const blob = await upload('big-file.mp4', file, {
  access: 'public',
  handleUploadUrl: '/api/upload',
  onUploadProgress: (progressEvent) => {
    console.log(`Loaded ${progressEvent.loaded} bytes`);
    console.log(`Total ${progressEvent.total} bytes`);
    console.log(`Percentage ${progressEvent.percentage}%`);
  },
});

Aborting Requests

  • Epycbyte Blob operations can be canceled using the AbortController API.
  • The abortSignal parameter is available on the put and upload methods.

Example: Aborting a Request

const abortController = new AbortController();
try {
  const blobPromise = epycbyteBlob.put('hello.txt', 'Hello World!', {
    access: 'public',
    abortSignal: abortController.signal,
  });
  // ...
} catch (error) {
  if (error instanceof epycbyteBlob.BlobRequestAbortedError) {
    console.info('canceled put request');
  }
}

Deleting All Blobs

  • Epycbyte Blob provides a method to delete all blobs in a store.
  • The del method is available on the list result.

Example: Deleting All Blobs

async function deleteAllBlobs() {
  let cursor;
  do {
    const listResult = await list({ cursor, limit: 1000 });
    if (listResult.blobs.length > 0) {
      await del(listResult.blobs.map((blob) => blob.url));
    }
    cursor = listResult.cursor;
  } while (cursor);
  console.log('All blobs were deleted');
}

More Resources

  • Server Upload Quickstart
  • Client Upload Quickstart
  • Epycbyte Blob SDK