from.download()

Downloads a file.

1const { data, error } = await supabase
2  .storage
3  .from('avatars')
4  .download('folder/avatar1.png')

Parameters#

  • pathrequired
    string

    The full path and file name of the file to be downloaded. For example folder/image.png.

Notes#

  • RLS policy permissions required:
    • buckets table permissions: none
    • objects table permissions: select
  • Refer to the Storage guide on how access control works

Examples#

Download file#

1const { data, error } = await supabase
2  .storage
3  .from('avatars')
4  .download('folder/avatar1.png')