JavaScript: Move an existing file (original) (raw)

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

Parameters

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

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

(Optional)
The destination options.

Examples

Move file

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