JavaScript: Copy an existing file

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

Parameters

Examples

Copy file

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