Category: Supabase and databases

Supabase Storage 413 EntityTooLarge on photo or video upload

Read this guide in Polish

HTTP 413 EntityTooLarge means exceeding the size limit during transmission. This is not a typical RLS permission error. Start by comparing the actual file size with project limits and a specific tray.

How to Recognize Cause

Check full response code and Storage message, not only general 'upload failed'. Save file size in bytes, bucket name and upload method. The file from the phone may be much larger than the thumbnail displayed on the interface.

The Supabase allows you to set a global limit and a lower limit for individual pickets. The actual permissible size results from both configurations, and the availability of higher values depends on the design plan.

Step by step solution

1. Open Supabase → Storage Settings and check Global file size limit. Do not change it without an estimate of the cost and demand of the application.

2 . Go to the picket destination settings and verify its own size limits and the MIME types allowed.

3 . If the file is more than a reasonable limit, show a clear message in the application before sending. If necessary, apply compression or separate path for large materials.

4 . For larger files, evaluate the resumable upload mechanism based on TUS, instead of repeatedly renewing one large standard upload via unstable link.

5 . If the file is within limits, check the proxy Next.js server or proxy that can also impose your own request limit.

How to see if the problem is gone

Test one file smaller than the limit and one bigger. The small should be saved and read, and the large should receive a controlled message without endless animation.

Check that the saved object has the correct size and metadata and that orphaned files have not been created after the incorrect or broken upload.

What to do

Do not disable RLS to repair 413 responses. Do not increase the global limit to a maximum for only one form with small attachments.