Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat: add minimum and maximum for file size limit

Beng Eu4ccd10e7b3e0
diff --git a/studio/components/to-be-cleaned/Storage/StorageSettings/StorageSettings.tsx b/studio/components/to-be-cleaned/Storage/StorageSettings/StorageSettings.tsx
index 748158dbbd2..6a0e0addb73 100644
--- a/studio/components/to-be-cleaned/Storage/StorageSettings/StorageSettings.tsx
+++ b/studio/components/to-be-cleaned/Storage/StorageSettings/StorageSettings.tsx
@@ -3,7 +3,7 @@ import { FC, useState } from 'react'
import { AutoField } from 'uniforms-bootstrap4'
import { Typography } from '@supabase/ui'
-import { API_URL } from 'lib/constants'
+import { API_URL, STORAGE_FILE_SIZE_LIMIT_MAX } from 'lib/constants'
import { patch, get } from 'lib/common/fetch'
import { useStore } from 'hooks'
import SchemaFormPanel from 'components/to-be-cleaned/forms/SchemaFormPanel'
@@ -58,9 +58,11 @@ const StorageConfig = ({ config, projectRef }: any) => {
schema={{
properties: {
fileSizeLimit: {
+ help: 'The maximum size in bytes of a file that can be uploaded.',
+ maximum: STORAGE_FILE_SIZE_LIMIT_MAX,
+ minimum: 0,
title: 'Upload file size limit',
type: 'integer',
- help: 'The maximum size in bytes of a file that can be uploaded.',
},
},
required: ['fileSizeLimit'],
diff --git a/studio/lib/constants/infrastructure.ts b/studio/lib/constants/infrastructure.ts
index 36e626507ce..d13a8e06b34 100644
--- a/studio/lib/constants/infrastructure.ts
+++ b/studio/lib/constants/infrastructure.ts
@@ -132,3 +132,5 @@ export const PASSWORD_STRENGTH_PERCENTAGE = {
}
export const DEFAULT_FREE_PROJECTS_LIMIT = 2
+
+export const STORAGE_FILE_SIZE_LIMIT_MAX = 5_368_709_120