Skills
Chapter 3 of 28
Store unstructured files in Encore.ts using Bucket from encore.dev/storage/objects — uploads, images, documents, blobs.
1 minute · 123 words · 7 sections
A Bucket is a logical store for files. Encore provisions the underlying object storage (S3 on AWS, GCS on GCP, in-memory locally). Declare buckets at package level.
import { Bucket } from "encore.dev/storage/objects";
// Private bucket (default)
export const uploads = new Bucket("user-uploads", {
versioned: false, // Set to true to keep multiple versions
});
// Public bucket — files accessible via public URL
export const publicAssets = new Bucket("public-assets", {
public: true,
versioned: false,
});// Upload
const attrs = await uploads.upload("path/to/file.jpg", buffer, {
contentType: "image/jpeg",
});
// Download
const data = await uploads.download("path/to/file.jpg");
// Existence check
const exists = await uploads.exists("path/to/file.jpg");
// Attributes (size, content type, ETag)
const meta = await uploads.attrs("path/to/file.jpg");
// Delete
await uploads.remove("path/to/file.jpg");
// List
for await (const entry of uploads.list({})) {
console.log(entry.key, entry.size);
}
// Public URL (only for public buckets)
const url = publicAssets.publicUrl("image.jpg");Generate temporary URLs so clients can upload/download directly without going through your service:
const uploadUrl = await uploads.signedUploadUrl("user-uploads/avatar.jpg", { ttl: 7200 });
const downloadUrl = await uploads.signedDownloadUrl("documents/report.pdf", { ttl: 7200 });Pass bucket access to other code with a specific permission set:
import { Uploader, Downloader } from "encore.dev/storage/objects";
const uploaderRef = uploads.ref<Uploader>();
const downloaderRef = uploads.ref<Downloader>();
// Permission types: Downloader, Uploader, Lister, Attrser, Remover,
// SignedDownloader, SignedUploader, ReadWriterObjectNotFound — object doesn’t existPreconditionFailed — upload preconditions not met (e.g. setIfNotExists)ObjectsError — base error typepublic: true only for assets meant for unauthenticated download.Install this repository
npx skills add encoredev/skills/plugin marketplace add encoredev/skillsSkills install per repository, not per chapter — the CLI has no documented per-skill form, so we do not print one.
Store unstructured files in Encore.ts using `Bucket` from `encore.dev/storage/objects` — uploads, images, documents, blobs.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 15 May 2026.SKILL.md, not by matching a directory convention. One layout observed: encore/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Encore, declaring 1 plugin. It is read for editorial metadata only — never as the skill index, which is always the repository tree./encoredev/skills.md, and each chapter at its own .md URL.