Skip to content

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

chore: update storage docs

Inian77d36e410372
diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml
index b3931572bca..581272785dd 100644
--- a/spec/supabase_js_v2.yml
+++ b/spec/supabase_js_v2.yml
@@ -4490,7 +4490,11 @@ functions:
```js
const { data, error } = await supabase
.storage
- .createBucket('avatars', { public: false })
+ .createBucket('avatars', {
+ public: false,
+ allowedMimeTypes: ['image/png'],
+ fileSizeLimit: 1024
+ })
```
- id: empty-bucket
@@ -4516,7 +4520,7 @@ functions:
$ref: '@supabase/storage-js.packages/StorageBucketApi.default.updateBucket'
notes: |
- RLS policy permissions required:
- - `buckets` table permissions: `update`
+ - `buckets` table permissions: `select` and `update`
- `objects` table permissions: none
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
examples:
@@ -4527,7 +4531,11 @@ functions:
```js
const { data, error } = await supabase
.storage
- .updateBucket('avatars', { public: false })
+ .updateBucket('avatars', {
+ public: false,
+ allowedMimeTypes: ['image/png'],
+ fileSizeLimit: 1024
+ })
```
- id: delete-bucket
@@ -4555,7 +4563,7 @@ functions:
notes: |
- RLS policy permissions required:
- `buckets` table permissions: none
- - `objects` table permissions: `insert`
+ - `objects` table permissions: only `insert` when you are uploading new files and `select`, `insert` and `update` when you are upserting files
- Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
- For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.
examples:
@@ -4608,7 +4616,6 @@ functions:
.from('avatars')
.update('public/avatar1.png', avatarFile, {
cacheControl: '3600',
- // Overwrite file if it exists
upsert: true
})
```
@@ -4733,6 +4740,26 @@ functions:
.createSignedUrls(['folder/avatar1.png', 'folder/avatar2.png'], 60)
```
+ - id: from-create-upload-signed-url
+ title: from.createUploadSignedUrl()
+ $ref: '@supabase/storage-js.packages/StorageFileApi.default.createUploadSignedUrl'
+ notes: |
+ - RLS policy permissions required:
+ - `buckets` table permissions: none
+ - `objects` table permissions: `select`
+ - Refer to the [Storage guide](/docs/guides/storage#access-control) on how access control works
+ examples:
+ - id: create-signed-urls
+ name: Create Signed URLs
+ isSpotlight: true
+ code: |
+ ```js
+ const { data, error } = await supabase
+ .storage
+ .from('avatars')
+ .createSignedUrls(['folder/avatar1.png', 'folder/avatar2.png'], 60)
+ ```
+
- id: from-get-public-url
title: from.getPublicUrl()
$ref: '@supabase/storage-js.packages/StorageFileApi.default.getPublicUrl'
@@ -4812,6 +4839,7 @@ functions:
transform: {
width: 100,
height: 100,
+ quality: 80
}
})
```