Files

Model files as typed records with built-in edge delivery.

Browsers and mobile apps upload straight to object storage. Napalm checks byte size and file headers before marking a record ready, and serves downloads from the edge.

Read the files docs

Direct uploads

Send bytes straight from the client to object storage.

Insert a file record with its expected byte size and select file_upload in one statement. Browsers and mobile apps upload directly against the returned presigned plan without proxying payloads through an app server.

File upload protocol
dbschema/queries/addScan.edgeql
select (insert Scan {  owner := global caller,  file_name := <str>$name,  file_size := <int64>$size,}) { id, file_upload }

Content verification

Reject spoofed file extensions before a record goes live.

A JPEG renamed contract.pdf never reaches Ready status. When an upload completes, Napalm checks the byte length, inspects the file header against your format constraint and deletes rejected uploads.

dbschema/default.gel
using extension files; type ContractPdf extending ext::files::File {  required deal: Deal;  constraint expression on (.file_format = ext::files::Format.Pdf);   access policy deal_members    allow select, insert using ((global caller in .deal.team.members) ?? false);}
Files and object storage

Public media

Publish public assets on your own TLS domain.

Overload file_is_public on avatars or catalog media for permanent unsigned URLs behind a custom domain with automatic TLS, while still enforcing schema write rules and format checks on upload.

dbschema/default.gel
type Avatar extending ext::files::File {  overloaded required file_is_public: bool {    default := true;  };  required owner: ext::auth::Identity;}
Files and object storage

Scoped downloads

Select signed download URLs right alongside row fields.

Include file_url beside your scalar fields in the same EdgeQL query. Napalm signs an edge download URL valid for 6 hours only when the file record passes the caller’s select policy.

Files and object storage
dbschema/queries/noteAttachments.edgeql
select Note {  title,  attachments: {    file_name,    file_size,    file_url,  } filter .file_status = ext::files::Status.Ready,}

Multipart transfers

Upload multi-gigabyte files in resumable parts.

napalm.upload splits large videos, checkpoints and datasets across presigned multipart URLs, reports byte-level progress and completes verification automatically.

app/upload.ts
const { data } = await db.POST('/query/addScan', {  body: { variables: { name: file.name, size: file.size } },})const verified = await napalm.upload(data.data[0].file_upload, file, {  onProgress: (sent, total) => setProgress(sent / total),})
TypeScript file uploads

Edge caching

Cache downloads globally with backup-safe retention.

Every account includes 500 GB of monthly download transfer before $0.04/GB edge rates apply. Deleted files stay retained until your oldest backup expires so branch restores never leave broken links.

$0.04 / GBfile download bandwidth past 500 GB a month

Pricing