Uploads a file to an existing bucket.
buckets
permissions: noneobjects
permissions: insert
The relative file path. Should be of the format folder/subfolder/filename.png. The bucket must already exist before attempting to update.
File object to be stored in the bucket.
undefined
Sets the retryAttempts parameter set across the storage client. Defaults to 10.
Pass a RetryController instance and call `cancel()` to cancel the retry attempts.
final avatarFile = File('path/to/file');
final String fullPath = await supabase.storage.from('avatars').upload(
'public/avatar1.png',
avatarFile,
fileOptions: const FileOptions(cacheControl: '3600', upsert: false),
);
final Uint8List avatarFile = file.bytes;
final String fullPath = await supabase.storage.from('avatars').uploadBinary(
'public/avatar1.png',
avatarFile,
fileOptions: const FileOptions(cacheControl: '3600', upsert: false),
);