Python: Download a file

Downloads a file from a private bucket. For public buckets, make a request to the URL returned from get_public_url instead.

Parameters

Examples

Download file

with open("./myfolder/avatar1.png", "wb+") as f:
  response = supabase.storage.from_("avatars").download(
    "folder/avatar1.png"
  )
  f.write(response)

Download file with transformations

with open("./myfolder/avatar1.png", "wb+") as f:
  response = supabase.storage.from_("avatars").download(
      "folder/avatar1.png",
      \{"transform": \{"width": 100, "height": 100, "quality": 80\}\},
  )
  f.write(response)