# Upload file size limits

> SupaHost Storage accepts files up to 50 MB each. What the 413 "Payload too large" error looks like, how bucket limits interact with it, and options for larger files.

Source: https://supahost.app/kb/upload-size-limit · Updated 2026-11-11

Each file you upload to SupaHost Storage can be up to 50 MB (52,428,800 bytes). The limit is set for the whole platform and can't be raised per project.

## What you see

```js
const { error } = await supabase.storage.from('videos').upload('intro.mp4', file)
console.log(error.message) // "The object exceeded the maximum allowed size"
```

The HTTP response is a 413:

```json
{"statusCode":"413","error":"Payload too large","message":"The object exceeded the maximum allowed size"}
```

## Why it happens

Storage enforces a global per-file limit, set on SupaHost to 50 MB. In open-source Supabase Storage, buckets can also have their own `file_size_limit`. A bucket limit can make uploads to that bucket stricter than the global limit, but never looser.

The limit is per file. There's no limit on the number of files, and your instance's total file storage (100 GB on Builder, 250 GB on Pro, 500 GB on Business, shared by all projects) is a separate quota.

## How to fix it

1. **Check the file size before uploading**, so users get a clear message instead of a failed request:

   ```js
   const MAX = 50 * 1024 * 1024
   if (file.size > MAX) {
     throw new Error(`Files must be under 50 MB (this one is ${(file.size / 1048576).toFixed(1)} MB)`)
   }
   ```

2. **Check the bucket's own limit** if uploads fail below 50 MB:

   ```sql
   select id, file_size_limit, allowed_mime_types from storage.buckets;
   ```

   A `file_size_limit` of `null` means only the global limit applies. A disallowed MIME type fails with a different error, so check `allowed_mime_types` too.

3. **Make files smaller.** There are no image transformations on SupaHost, so resize photos in the browser or app before upload. That saves storage and egress too:

   ```js
   async function shrink(file, maxWidth = 1600) {
     const img = await createImageBitmap(file)
     const scale = Math.min(1, maxWidth / img.width)
     const canvas = new OffscreenCanvas(img.width * scale, img.height * scale)
     canvas.getContext('2d').drawImage(img, 0, 0, canvas.width, canvas.height)
     return canvas.convertToBlob({ type: 'image/webp', quality: 0.85 })
   }
   ```

   For video and audio, transcode to a lower bitrate before upload.

4. **Split large files into parts** if they must live in Storage. Upload `backup.zip.part-001`, `part-002` and so on, each under 50 MB, record the parts in a table, and join them after download.

5. **Keep very large files in object storage** such as S3 or Cloudflare R2, and store only the object key and metadata in your Postgres tables.

## On SupaHost

Files live on your instance's disk, and the disk grows automatically as it fills. Usage alert emails (at the threshold you choose, and at 100%) warn you before you use up your plan's file storage. You can buy more file storage under *Usage & billing → Add-ons*.

Edge Functions that proxy uploads have their own limits: each run gets 150 MB of memory, so stream large bodies rather than buffering them.

## Related

- [Storage limits and quotas](/docs/storage/limits)
- [Uploading files](/docs/storage/uploads)
- [Images without transformations](/docs/storage/images)
- [Unexpectedly high storage usage](/kb/storage-high-usage)
