Move an existing file
Moves an existing file, optionally renaming it at the same time.
- Policy permissions required:
buckets
permissions: noneobjects
permissions:update
andselect
- Refer to the Storage guide on how access control works
Parameters
fromPath
REQUIRED
StringThe original file path, including the current file name. For example folder/image.png.
toPath
REQUIRED
StringThe 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');