Download a file
Downloads a file.
- Policy permissions required:
buckets
permissions: noneobjects
permissions:select
- Refer to the Storage guide on how access control works
Parameters
path
REQUIRED
StringThe full path and file name of the file to be downloaded. For example folder/image.png.
transform
Optional
TransformOptionsTransform the asset before serving it to the client.
width
Optional
intThe width of the image in pixels.
height
Optional
intThe height of the image in pixels.
resize
Optional
ResizeModeSpecifies how image cropping should be handled when performing image transformations. Defaults to `ResizeMode.cover`.
quality
Optional
intSet the quality of the returned image. A number from 20 to 100, with 100 being the highest quality. Defaults to 80
format
Optional
RequestImageFormatSpecify the format of the image requested. When using 'origin' we force the format to be the same as the original image. When this option is not passed in, images are optimized to modern image formats like Webp.
final Uint8List file = await supabase
.storage
.from('avatars')
.download('avatar1.png');