Skip to content

How it works

From an upload in your app to a file served at the edge, step by step.

Applies to EngineCloud
View as Markdown
On this page
  1. Your app asks to upload
  2. Files checks your rules
  3. The object is stored
  4. Someone downloads it
  5. Images on the way out
  6. Two addresses
  1. Your app asks to upload

    The SDK sends the file to https://<ref>.files.sypnia.com/object/<bucket>/<path> with the signed-in user’s token. For big files it uses the resumable protocol and sends it in parts.

  2. Files checks your rules

    Files reads who the user is from the token, and asks your project’s Postgres whether the policies on sypnia_files.objects allow this insert for this bucket and path. If not, the answer is 403 and nothing is stored.

  3. The object is stored

    The bytes go to S3 (or your bucket) under the project’s prefix; a row in sypnia_files.objects records the bucket, path, size, type, owner and a checksum. With scanning on, the row stays pending until the scan says clean.

  4. Someone downloads it

    A public file is served from https://<ref>.files.sypnia.app/<bucket>/<path> through the CDN. A private file is served to whoever the rules allow, with a signed URL or with their token, and never cached for others.

  5. Images on the way out

    ?width=400&format=webp on an image URL returns a resized copy, made once and cached at the edge.

Two addresses

AddressFor
https://<ref>.files.sypnia.comthe API: uploads, listing, policies, signed URLs, the S3 API
https://<ref>.files.sypnia.appthe content: files and image transforms, on a separate domain so an uploaded HTML or SVG file can never touch Sypnia’s cookies
  1. Your app asks to upload
  2. Files checks your rules
  3. The object is stored
  4. Someone downloads it
  5. Images on the way out
  6. Two addresses

    Search pages, sections and terms