from.createSignedUrl()
Create signed URL to download file without requiring permissions. This URL can be valid for a set number of seconds.
const { signedURL, error } = await supabase
.storage
.from('avatars')
.createSignedUrl('folder/avatar1.png', 60)
Parameters
pathrequired
string
The file path to be downloaded, including the current file name. For example
folder/image.png
.expiresInrequired
number
The number of seconds until the signed URL expires. For example,
60
for a URL which is valid for one minute.
Notes
- Policy permissions required:
buckets
permissions: noneobjects
permissions:select
Examples
Create Signed URL
const { signedURL, error } = await supabase
.storage
.from('avatars')
.createSignedUrl('folder/avatar1.png', 60)