drift Docs
Start
What is Drift?
The tour, if you are new here.
Use cases
Whether Drift does your thing.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, four unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Accounts, tokens and scopes.
Security
Boundaries, sandboxing and hardening.
Troubleshooting
Error codes
What went wrong, and what to do about it.
Legal
Acceptable use
What a slice may not be used for.
Data processing
The DPA, and every sub-processor.

Backbone Blobs

Binary object storage. Files are addressed as bucket/key (a bare name lands in the default bucket):

A bucket has to exist on the slice before you can write to it.

A put naming a bucket the slice does not have is refused with 400, rather than creating one — and that includes default, so a bare key needs default to be a declared bucket. Buckets are part of a slice's shape, so they are declared where the shape lives; see the Driftfile reference. The refusal is the same for collections and SQL databases.
Go
drift.Backbone.Blob.Put("uploads/photo.jpg", data, "image/jpeg")
photo, _ := drift.Backbone.Blob.Get("uploads/photo.jpg")
Shell
drift backbone blob put    uploads photo.jpg ./photo.jpg
drift backbone blob get    uploads photo.jpg > downloaded.jpg
drift backbone blob list   uploads
drift backbone blob delete uploads photo.jpg

Keys with slashes hide from listings

The SDK splits the name on its first slash, so Put("submissions/case-1/file.pdf", …) stores bucket submissions, key case-1/file.pdf, and the key becomes a subdirectory on disk. blob list reads only the top level of a bucket and skips directories, so that blob never appears in drift backbone blob list submissions. A slice snapshot captures blobs by walking the same listing, so it is absent from the archive too. Keep keys flat if you want them listed and backed up.

A bucket name takes alphanumerics plus ., _ and -, first character alphanumeric, up to 255 bytes, and no slashes. A key takes the same set plus /, up to 513 bytes. Neither may contain ... A name outside the charset fails the put with 500, not 400.

Content type is not returned

The content type you pass is recorded alongside the blob and never read back. Get returns the decrypted bytes with no Content-Type header, so a browser fetching a blob gets no type information from the platform. Set the header yourself in the function that serves the file.