from.createSignedUrl()
Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.
1const { data, error } = await supabase
2 .storage
3 .from('avatars')
4 .createSignedUrl('folder/avatar1.png', 60)
Parameters#
pathrequired
stringThe file path, including the current file name. For example
folder/image.png.expiresInrequired
numberThe number of seconds until the signed URL expires. For example,
60for a URL which is valid for one minute.optionsoptional
objectNo description provided.
downloadrequired
|stringbooleantriggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
stringrequired
objectNo description provided.
booleanrequired
objectNo description provided.
Properties
Properties
Notes#
- RLS policy permissions required:
bucketstable permissions: noneobjectstable permissions:select
- Refer to the Storage guide on how access control works
Examples#
Create Signed URL#
1const { data, error } = await supabase
2 .storage
3 .from('avatars')
4 .createSignedUrl('folder/avatar1.png', 60)