from.update()

用一个新的文件替换指定路径下的一个现有文件。

final avatarFile = File('path/to/file');
final res = await supabase
  .storage
  .from('avatars')
  .update('public/avatar1.png', avatarFile, fileOptions: FileOptions(
    cacheControl: '3600',
    upsert: false
  ));

Notes

  • 所需的策略权限:
    • buckets 权限: none
    • objects 权限: update and select

Examples

更新文件

final avatarFile = File('path/to/file');
final res = await supabase
  .storage
  .from('avatars')
  .update('public/avatar1.png', avatarFile, fileOptions: FileOptions(
    cacheControl: '3600',
    upsert: false
  ));

results matching ""

    No results matching ""