Skip to main content
Version: v2 RC

from.move()

Moves an existing file to a new path in the same bucket.

const { data, error } = await supabase
.storage
.from('avatars')
.move('public/avatar1.png', 'private/avatar2.png')

Parameters

  • fromPathrequiredstring

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

  • toPathrequiredstring

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

Notes

  • RLS policy permissions required:
    • buckets table permissions: none
    • objects table permissions: update and select
  • Refer to the Storage guide on how access control works

Examples

Move file

const { data, error } = await supabase
.storage
.from('avatars')
.move('public/avatar1.png', 'private/avatar2.png')