Skip to main content

Store and deliver
any file

Upload images, documents, and media; control access with security rules or RLS; deliver via CDN, image processing, and signed links.

storage / assetscdn enabled
public-assets
objecttype · sizeaccess
images/launch-cover.webpimage · 428 KBpublic
avatars/usr_8f31.pngimage · 86 KBrls
reports/2026-07.pdfpdf · 1.8 MBsigned
videos/product-tour.mp4video · 24 MBcdn
delivery

CDN acceleration

Cache policy · custom domain

transform

Image processing

Resize · crop · format conversion

security

Content moderation

Images · video · text

One path for upload, authorization, and delivery

Your app cares about objects and paths; CloudBase enforces policies at the access layer and delivers files for public or private scenarios.

object delivery flowpolicy passed
01 · Upload

Upload objects via SDK

Bucket · object path · metadata

02 · Authorize

Verify access policies

Security rules or PostgreSQL RLS

03 · Deliver

Deliver by scenario

CDN · public URL · signed link

stageresourcestate
object.writeavatars/usr_8f31.pngaccepted
policy.selectauth.uid() = owner_idpassed
edge.cacheimage/webpready

From object management to secure delivery

Covers the storage, processing, permissions, and delivery primitives you use most across the file lifecycle.

01

CDN acceleration

Static files are cached and delivered via CDN; public buckets can use custom domains as entry points.

DELIVERY
02

Image processing

Use CI parameters for resize, crop, rotate, format conversion, and quality control — no need to pre-generate every size.

IMAGE MOGR2
03

Two permission models

Standard mode uses file-level security rules; PG mode uses RLS policies on storage.objects and storage.buckets.

RULES / RLS
04

Signed access links

Private buckets can generate time-limited links for specific objects, with optional download filenames.

SIGNED URL
05

Bucket and object management

Upload, download, list, copy, move, and delete objects — organize business files by bucket and path.

OBJECT API
06

Content moderation

Configure moderation workflows for images, video, audio, text, and documents with CI.

MODERATION
Storage isn't done when upload succeeds — it's when the right person gets the file at the right time, the right way.
Product design principle

Public assets via CDN, private files via signed links

Choose access by bucket and scenario; permission checks always happen before delivery.

View access and download
DELIVERY POLICY
publicCDN public delivery
privateTime-limited signed links
transformOn-demand image processing
guardSecurity rules / RLS

Manage objects and access with real SDK calls

Examples follow in-repo SDK and image processing docs; product scope matches current documentation.

Upload business files to a bucket

In PG mode, app.storage.from(bucketId) returns the object client; paths are always relative to the bucket.

  • Set contentType and custom metadata
  • upsert overwrites objects at the same path
  • Writes are governed by the matching RLS policy
upload-avatar.js
import cloudbase from '@cloudbase/js-sdk'

const app = cloudbase.init({ env: '<envId>' })
const bucket = app.storage.from('avatars')

const { data, error } = await bucket.upload(
  `${user.id}/avatar.png`,
  file,
  {
    contentType: 'image/png',
    upsert: true,
    metadata: { usage: 'avatar' }
  }
)

if (error) throw error

Generate time-limited links for private files

Signed links limit downloads to a specific object and expiry — ideal for invoices, reports, and user attachments.

  • Expiry is specified in seconds
  • Generating links requires object SELECT permission
  • You can set the browser download filename
signed-download.js
const bucket = app.storage.from('private-files')

const { data, error } =
  await bucket.createSignedUrl(
    `${user.id}/report.pdf`,
    600,
    { download: 'report.pdf' }
  )

if (error) throw error
window.location.assign(data.signedUrl)

Pick size and format at request time

Append CI processing parameters to the image URL to combine resize, format conversion, and quality control.

  • Generate thumbnails with width/height constraints
  • Convert to WebP, AVIF, and other formats
  • Capabilities and billing follow your CI configuration
responsive-image.js
const source =
  'https://<domain>/images/cover.jpg'

const thumbnail =
  source +
  '?imageMogr2/thumbnail/640x640' +
  '/format/webp/rquality/80'

// 在请求时按需缩放、转格式与控制质量
image.src = thumbnail

File capabilities connect every delivery surface

The same object data can reach Web, mini programs, server-side code, and content processing pipelines.

01

App files

Avatars, attachments, reports, and user-generated content.

02

Site assets

Images, scripts, download packages, and static media.

03

Content processing

Image processing, document preview, and content moderation.

Web SDKMini Program SDKBucketSecurity rulesPostgreSQL RLSCDNCustom domainSigned linksCloud Infinite (CI)Content moderation

Put storage, permissions, and delivery on one path

Create a bucket, choose a permission model, then start with your first upload API.