from.move()
Moves an existing file.
const { data, error } = await supabase
.storage
.from('avatars')
.move('public/avatar1.png', 'private/avatar2.png')
Parameters
fromPathrequired
string
The original file path, including the current file name. For example
folder/image.png
.toPathrequired
string
The new file path, including the new file name. For example
folder/image-new.png
.
Notes
- Policy permissions required:
buckets
permissions: noneobjects
permissions:update
andselect
Examples
Move file
const { data, error } = await supabase
.storage
.from('avatars')
.move('public/avatar1.png', 'private/avatar2.png')