Upload a file
- Policy permissions required:
buckets
permissions: noneobjects
permissions:insert
- For React Native, using either
Blob
,File
orFormData
does not work as intended. Upload file usingArrayBuffer
from base64 file data instead, see example below.
const avatarFile = event.target.files[0]
const { data, error } = await supabase
.storage
.from('avatars')
.upload('public/avatar1.png', avatarFile, {
cacheControl: '3600',
upsert: false
})