Docs

Working with files

Paths and folders, uploading (and replacing), large files with resumable uploads, listing, moving and renaming, downloading and deleting, and the limits that apply.

Updated Nov 4, 2026

#Paths and folders

A file is addressed by its bucket and a path: avatars + 6e19…/photo.png. Folders are just the parts of the path before the last /; they exist as long as something is in them (New folder in the console creates an empty placeholder). Use the user's id as the first folder for per-user files — the own folder rules check exactly that (Access, links and delivery).

Keep names URL-safe (letters, digits, -, _, ., /); the SDKs encode anything else.

#Upload

const user = await sovaria.auth.me()
await sovaria.storage.upload('avatars', `${user.id}/photo.png`, file, {
  contentType: 'image/png',
  upsert: true,          // replace the file if it exists
})

Or one bucket at a time, as in supabase-js: every call resolves to { data, error } and never throws (except getPublicUrl, which needs the project id — known once the client has looked it up, or after await sovaria.resolveScope()). In the Swift, Kotlin and Dart SDKs storage is where the session is kept, so buckets are sovaria.files.from(…).

const avatars = sovaria.storage.from('avatars')
const { data, error } = await avatars.upload(`${user.id}/photo.png`, file, { upsert: true })
const { data: blob } = await avatars.download(`${user.id}/photo.png`)
const { data: files } = await avatars.list(user.id, { limit: 50, search: 'photo' })   // names relative to the folder
await avatars.remove([`${user.id}/old.png`])
const { data: { signedUrl } } = await avatars.createSignedUrl(`${user.id}/photo.png`, 3600)
const { data: { publicUrl } } = sovaria.storage.from('public-images').getPublicUrl('logo.png')
SituationResult
The path is newThe file is stored.
The path exists, without upsert409 Object … already exists — nothing is overwritten.
The path exists, with upsert: trueThe file is replaced. There is no version history for files.
Bigger than the bucket's or plan's largest file413.
Type not in the bucket's allowed typesRefused.
The project's storage is full403 with a plan code (Free stops; paid plans bill beyond — Billing, invoices and overage).

For browser uploads straight to Sovaria without passing through your server, create a signed upload URL on your server and let the browser PUT the file to it (Access, links and delivery).

#Large files: resumable uploads

For files of tens of megabytes or more, or unreliable networks, upload in chunks and resume after a failure. The TypeScript and Python SDKs do the whole protocol for you: they send 6 MB chunks (at least 256 KB), report progress with the upload's id, and given that id later carry on from the offset the server already has.

const bucket = sovaria.storage.from('videos')

const { data, error } = await bucket.uploadResumable(`${userId}/clip.mp4`, file, {
  contentType: 'video/mp4',
  onProgress: ({ uploadId, sent, total }) => {
    localStorage.setItem('clip-upload', uploadId)      // keep it to resume later
    setProgress(sent / total)
  },
})

// After a dropped connection or a reload: continue where the server stopped
await bucket.uploadResumable(`${userId}/clip.mp4`, file, { uploadId: localStorage.getItem('clip-upload') ?? undefined })

Without an SDK, use the protocol directly (TUS-style):

  1. Start

    Returns 201 with a Location header for the upload.

    curl -si -X POST "$URL/api/v1/store/resumable/videos/$USER_ID/clip.mp4" \
      -H "Authorization: Bearer $TOKEN" -H "Upload-Length: 734003200"
    # Location: /api/v1/store/resumable/<upload-id>   Upload-Offset: 0
  2. Send chunks

    Each PATCH carries the offset it starts at; a wrong offset is refused so chunks can't be appended twice.

    curl -s -X PATCH "$URL/api/v1/store/resumable/<upload-id>" \
      -H "Authorization: Bearer $TOKEN" -H "Upload-Offset: 0" \
      -H 'Content-Type: application/offset+octet-stream' --data-binary @chunk-0
  3. Resume after a failure

    HEAD the upload to read Upload-Offset, then continue from there.

  4. Finish

    Send the last chunk with X-Upload-Complete: 1; the file appears in the bucket.

An unfinished upload survives server restarts and can be continued from any device. It expires after 24 hours without a chunk, and its chunks count toward your storage until it finishes or expires. A project can keep up to 20 unfinished uploads at once.

The S3-compatible storage access API also supports multipart uploads, so aws s3 cp, rclone and S3 libraries handle large files for you.

#Malware scanning

Uploads can be checked for malware before they are stored (ClamAV; Sovaria turns it on for the platform). It covers every way in — the SDK and console, signed upload URLs, resumable uploads and the S3 API. A file found to be malware is refused and never reaches your bucket:

HTTP 422
{ "detail": { "code": "MALWARE_DETECTED", "signature": "Win.Trojan.Agent-…",
  "message": "This file was refused: the virus scanner found Win.Trojan.Agent-…. It was not stored." } }
  • Show the message to the user; retrying the same file gives the same answer. The S3 API answers 403 AccessDenied with the same reason.
  • The refused file is kept for 30 days in a quarantine only Sovaria staff can open (for false-positive review), never in your bucket, and your project's audit log records it (object.malware_refused).
  • Very large files (over the platform's scan limit, 25 MB by default) are stored without a scan, so keep your own checks for big uploads you don't trust.
  • If the scanner is briefly unavailable, uploads are stored as usual (or, if the platform is set to be strict, refused with 503 SCANNER_UNAVAILABLE — retry shortly).

#List, move, rename, delete

const files = await sovaria.storage.listObjects('avatars', { prefix: `${user.id}/` })

// Move or rename (both paths are bucket/path)
await sovaria.storage.moveObject({ from_path: `avatars/${user.id}/old.png`, to_path: `avatars/${user.id}/new.png` })

await sovaria.storage.remove('avatars', `${user.id}/new.png`)
  • Listing returns each file's path, size, content type and last change.
  • A move needs READ and DELETE on the old path and WRITE on the new one (it reads the file and removes the original).
  • Deleting is immediate and permanent — there is no trash. Deleting a bucket deletes every file in it.

#Copy, details and exists

copy duplicates a file inside a bucket or into another one: it needs READ on the source and WRITE on the destination path, and the copy meets the destination bucket's type and size rules and your storage quota, like an upload of the same file. Without upsert an existing file at the destination is a 409. info returns a file's size, content type, cache control, etag and dates without downloading it; exists is info that answers true or false (a file this user can't read is "not there").

const docs = sovaria.storage.from('docs')
await docs.copy(`${user.id}/draft.pdf`, `${user.id}/final.pdf`)
await docs.copy(`${user.id}/final.pdf`, `${user.id}/final.pdf`, { destinationBucket: 'archive' })
await docs.move(`${user.id}/old.pdf`, `${user.id}/2025/old.pdf`)
const { data: info } = await docs.info(`${user.id}/final.pdf`)   // size, content_type, cache_control, etag, updated_at
const { data: there } = await docs.exists(`${user.id}/final.pdf`)

#Cache control

Pass cacheControl (seconds, e.g. '3600') when uploading to tell browsers and CDNs how long they may keep the file: it is stored with the file and sent back as Cache-Control on downloads, public URLs and transformed images (up to one year; anything but a number of seconds is a 400). Without it, public files are cached for 5 minutes and other downloads aren't cached.

await sovaria.storage.from('assets').upload('logo.svg', file, { cacheControl: '86400', upsert: true })

#Download

sovaria.storage.download(bucket, path) returns a Blob for the signed-in user. For <img> tags and links, use a public URL (public buckets) or a signed URL (private ones) instead of downloading in JavaScript — Access, links and delivery.

#Limits

FreeProUltraTeamEnterprise
Object storage1 GB20 GB100 GB500 GB5 TB
Files100 MB2 GB10 GB50 GB100 GB
Buckets31005002,00010,000
Monthly bandwidth2,147,483,64821,474,836,48064,424,509,440429,496,729,6005,497,558,138,880

A bucket can set a lower largest-file size and a list of allowed content types (Bucket › Settings, or file_size_limit / allowed_mime_types when creating it).

#Coming from Firebase or Supabase?

PlatformWhat this is called there
FirebaseFirebase Storage uploadBytes and getDownloadURL
SupabaseSupabase Storage upload and download
SovariaWorking with files

Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.