Dart Reference v2.0

Move an existing file

Moves an existing file, optionally renaming it at the same time.

  • Policy permissions required:
    • buckets permissions: none
    • objects permissions: update and select
  • Refer to the Storage guide on how access control works
Parameters
    fromPath
    REQUIRED
    String

    The original file path, including the current file name. For example folder/image.png.

    toPath
    REQUIRED
    String

    The new file path, including the new file name. For example folder/image-new.png.


final String result = await supabase
  .storage
  .from('avatars')
  .move('public/avatar1.png', 'private/avatar2.png');